Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
rm03 committed Nov 28, 2023
1 parent 95ea040 commit 7878693
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions backend/clubs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4479,7 +4479,7 @@ def question_response(self, *args, **kwargs):
submissions page""",
}
)
submission, _ = ApplicationSubmission.objects.update_or_create(
submission, _ = ApplicationSubmission.objects.get_or_create(
user=self.request.user,
application=application,
committee=committee,
Expand Down Expand Up @@ -4507,23 +4507,23 @@ def question_response(self, *args, **kwargs):
):
text = question_data.get("text", None)
if text is not None and text != "":
obj, _ = ApplicationQuestionResponse.objects.get_or_create(
question=question, submission=submission,
obj, _ = ApplicationQuestionResponse.objects.update_or_create(
question=question,
submission=submission,
defaults={"text": text},
)
obj.text = text
obj.save()
response = Response(ApplicationQuestionResponseSerializer(obj).data)
elif question_type == ApplicationQuestion.MULTIPLE_CHOICE:
multiple_choice_value = question_data.get("multipleChoice", None)
if multiple_choice_value is not None and multiple_choice_value != "":
multiple_choice_obj = ApplicationMultipleChoice.objects.filter(
question=question, value=multiple_choice_value
).first()
obj, _ = ApplicationQuestionResponse.objects.get_or_create(
question=question, submission=submission,
obj, _ = ApplicationQuestionResponse.objects.update_or_create(
question=question,
submission=submission,
defaults={"multiple_choice": multiple_choice_obj},
)
obj.multiple_choice = multiple_choice_obj
obj.save()
response = Response(ApplicationQuestionResponseSerializer(obj).data)
return response

Expand Down

0 comments on commit 7878693

Please sign in to comment.