This commit is contained in:
mrkrk 2024-08-27 13:09:36 +03:00 committed by GitHub
parent d36af3ad73
commit 091b0a7968
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -121,6 +121,7 @@ class Answer(BaseModel):
for question in questions: for question in questions:
if question.required and question.id not in uuids: if question.required and question.id not in uuids:
raise ValueError(AnswerError.REQUIRED_QUIESTION_NOT_ANSWERED.value) raise ValueError(AnswerError.REQUIRED_QUIESTION_NOT_ANSWERED.value)
if uuids.get(question.id):
if question.question_type != uuids[question.id].question_type: if question.question_type != uuids[question.id].question_type:
raise ValueError(AnswerError.REQUIRED_QUIESTION_NOT_ANSWERED.value) raise ValueError(AnswerError.REQUIRED_QUIESTION_NOT_ANSWERED.value)
uuids[question.id].validate(question) uuids[question.id].validate(question)