Merge branch 'сja' into develop
This commit is contained in:
commit
a836faa5cf
1 file changed
+2
-2
@@ -113,7 +113,7 @@ class VoteCreate(APIView):
|
|||||||
|
|
||||||
questions = json.loads(request.data['questions'])
|
questions = json.loads(request.data['questions'])
|
||||||
for count, question_data in enumerate(questions, start=1):
|
for count, question_data in enumerate(questions, start=1):
|
||||||
question_image = questions_files.get(question_data['image']['name']) if 'image' in question_data else None
|
question_image = questions_files.get(question_data['image']['name']) if 'image' in question_data and question_data['image'] is not None else None
|
||||||
question = Question.objects.create(
|
question = Question.objects.create(
|
||||||
name=question_data['text'],
|
name=question_data['text'],
|
||||||
vote=vote,
|
vote=vote,
|
||||||
@@ -123,7 +123,7 @@ class VoteCreate(APIView):
|
|||||||
)
|
)
|
||||||
|
|
||||||
for answer in question_data['answers']:
|
for answer in question_data['answers']:
|
||||||
answer_image = answers_files.get(answer['image']['name']) if 'image' in answer else None
|
answer_image = answers_files.get(answer['image']['name']) if 'image' in answer and answer['image'] is not None else None
|
||||||
Answer.objects.create(
|
Answer.objects.create(
|
||||||
name=answer['text'],
|
name=answer['text'],
|
||||||
file=answer_image,
|
file=answer_image,
|
||||||
|
|||||||
Reference in new issue
Block a user