mirror of
https://github.com/lemeow125/DocManagerBackend.git
synced 2025-01-18 17:13:00 +08:00
Fix error with questionnaire submissions not tied to requests
This commit is contained in:
parent
6f276b43cc
commit
75d62014fb
1 changed files with 4 additions and 1 deletions
|
@ -69,7 +69,10 @@ class QuestionnaireSerializer(serializers.ModelSerializer):
|
|||
)
|
||||
|
||||
if "document_request" in validated_data:
|
||||
if validated_data["document_request"]:
|
||||
document_request_id = validated_data["document_request"].id
|
||||
else:
|
||||
document_request_id = None
|
||||
del validated_data["document_request"]
|
||||
|
||||
instance = self.Meta.model(**validated_data)
|
||||
|
|
Loading…
Reference in a new issue