Skip to content

Commit

Permalink
dont remove field if it is not there
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebPena committed Dec 3, 2024
1 parent a290d8c commit ea63440
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion screener/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ def update(self, instance, validated_data):

# don't update create only fields
for field in self.Meta.create_only_fields:
validated_data.pop(field)
if field in validated_data:
validated_data.pop(field)

Screen.objects.filter(pk=instance.id).update(**validated_data)
HouseholdMember.objects.filter(screen=instance).delete()
Expand Down

0 comments on commit ea63440

Please sign in to comment.