Skip to content

Commit

Permalink
fix: save MeetingRegistration.checkedin as boolean value (#4446)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpcross authored Sep 14, 2022
1 parent 79bf320 commit 5b6695a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ietf/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ def err(code, text):
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():
Expand Down
2 changes: 1 addition & 1 deletion ietf/stats/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 5b6695a

Please sign in to comment.