mirror of
https://github.com/lemeow125/DocManagerBackend.git
synced 2025-01-19 01:23:02 +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 "document_request" in validated_data:
|
||||||
document_request_id = validated_data["document_request"].id
|
if validated_data["document_request"]:
|
||||||
|
document_request_id = validated_data["document_request"].id
|
||||||
|
else:
|
||||||
|
document_request_id = None
|
||||||
del validated_data["document_request"]
|
del validated_data["document_request"]
|
||||||
|
|
||||||
instance = self.Meta.model(**validated_data)
|
instance = self.Meta.model(**validated_data)
|
||||||
|
|
Loading…
Reference in a new issue