diff --git a/gregui/api/views/invitation.py b/gregui/api/views/invitation.py index 47160a3fb191b9cbc8369089e2abffeccf39ee05..d4027b0224f375134a0179459c1b9a250579aa27 100644 --- a/gregui/api/views/invitation.py +++ b/gregui/api/views/invitation.py @@ -362,6 +362,10 @@ class InvitedGuestView(GenericAPIView): illegal_field_updates = [] for changed_field in changed_fields: + if changed_field == "consents": + # Consents can be inserted and updated, no need for further checks on them + continue + try: attribute = getattr(person, changed_field) except AttributeError: @@ -376,7 +380,12 @@ class InvitedGuestView(GenericAPIView): # No existing value for field, so allow change continue else: - if attribute != person_data[changed_field]: + # Quick fix to be able compare date with string + if changed_field == "date_of_birth": + if attribute.strftime("%Y-%m-%d") != person_data[changed_field]: + # There is an existing date value + illegal_field_updates.append(changed_field) + elif attribute != person_data[changed_field]: # There is an existing value illegal_field_updates.append(changed_field)