Fixed a problem with the handling of multiple registrations for the same person and meeting in api_new_meeting_registration().

- Legacy-Id: 18059
This commit is contained in:
Henrik Levkowetz 2020-06-24 20:49:13 +00:00
parent a827c482c2
commit b332233d6f

View file

@ -165,9 +165,13 @@ def api_new_meeting_registration(request):
for key in set(data.keys())-set(['attended', 'apikey', 'meeting', 'email',]):
new = data.get(key)
cur = getattr(object, key, None)
if key in ['reg_type', 'ticket_type', ] and cur and not new in cur:
if key in ['reg_type', 'ticket_type', ] and new:
# Special handling for multiple reg types
setattr(object, key, cur+' '+new)
if cur:
if not new in cur:
setattr(object, key, cur+' '+new)
else:
setattr(object, key, new)
else:
setattr(object, key, new)
person = Person.objects.filter(email__address=email)