Skip to content

Commit

Permalink
Slightly clean up draft validation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-Jess committed Mar 27, 2024
1 parent 2cfb9dc commit 49793f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/sublet/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def validate_publish(self, validated_data, instance=None):
newest_fields = [
(field, validated_data[field])
if field in validated_data
else (field, getattr(instance, field))
if instance and hasattr(instance, field)
else (field, getattr(instance, field, None))
if instance
else (field, None)
for field in fields
]
Expand Down

0 comments on commit 49793f9

Please sign in to comment.