From 88598615708c6711c2fbbfffd900f5eec187e589 Mon Sep 17 00:00:00 2001 From: Jesse Zong Date: Wed, 27 Mar 2024 22:38:15 -0400 Subject: [PATCH] Clean up draft validation logic further --- backend/sublet/serializers.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/backend/sublet/serializers.py b/backend/sublet/serializers.py index 4b5c9b35..30d2e949 100644 --- a/backend/sublet/serializers.py +++ b/backend/sublet/serializers.py @@ -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 ]