Skip to content

Commit

Permalink
问卷后端检查必填题是否作答
Browse files Browse the repository at this point in the history
  • Loading branch information
Deophius authored and pkuGenuine committed Aug 8, 2024
1 parent 20b0364 commit 5268db3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dormitory/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def post(self):
for question in survey.questions.order_by('order'):
answer = self.request.POST.get(str(question.order))
if answer is None:
assert not question.required, f"必填题{question.order}未作答"
continue
AnswerText.objects.create(question=question,
answersheet=sheet,
Expand Down

0 comments on commit 5268db3

Please sign in to comment.