From 5b6695a04c46e1756183272e8da4195f1ebea1a7 Mon Sep 17 00:00:00 2001 From: Ryan Cross Date: Wed, 14 Sep 2022 07:55:08 -0700 Subject: [PATCH] fix: save MeetingRegistration.checkedin as boolean value (#4446) --- ietf/api/views.py | 5 ++++- ietf/stats/utils.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ietf/api/views.py b/ietf/api/views.py index f4d9a23dc..97a551789 100644 --- a/ietf/api/views.py +++ b/ietf/api/views.py @@ -180,7 +180,10 @@ def api_new_meeting_registration(request): try: # Update attributes for key in set(data.keys())-set(['attended', 'apikey', 'meeting', 'email']): - new = data.get(key) + if key == 'checkedin': + new = bool(data.get(key).lower() == 'true') + else: + new = data.get(key) setattr(object, key, new) person = Person.objects.filter(email__address=email) if person.exists(): diff --git a/ietf/stats/utils.py b/ietf/stats/utils.py index 25553192d..b6ff321e3 100644 --- a/ietf/stats/utils.py +++ b/ietf/stats/utils.py @@ -263,7 +263,7 @@ def get_meeting_registration_data(meeting): address = registration['Email'].strip() reg_type = registration['RegType'].strip() ticket_type = registration['TicketType'].strip() - checkedin = registration['CheckedIn'].strip() + checkedin = bool(registration['CheckedIn'].strip().lower() == 'true') if (address, reg_type) in meeting_registrations: object = meeting_registrations.pop((address, reg_type))