Skip to content

Commit

Permalink
Clean up draft validation logic further
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-Jess committed Mar 28, 2024
1 parent 49793f9 commit 8859861
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions backend/sublet/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,16 @@ def validate_publish(self, validated_data, instance=None):
]

newest_fields = [
(field, validated_data[field])
if field in validated_data
else (field, getattr(instance, field, None))
if instance
else (field, None)
(
field,
(
validated_data[field]
if field in validated_data
else getattr(instance, field, None)
if instance
else None
),
)
for field in fields
]

Expand Down

0 comments on commit 8859861

Please sign in to comment.