Skip to content

Commit 59487f5

Browse files
committed
Fixed an issue with multiple objects matching a registsration record fetched from the registration system (this has been caused by not correctly detecting changes in registration system details).
- Legacy-Id: 17953
1 parent 73a0627 commit 59487f5

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

ietf/stats/utils.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,19 @@ def get_meeting_registration_data(meeting):
247247
affiliation = registration['Company'].strip()
248248
country_code = registration['Country'].strip()
249249
address = registration['Email'].strip()
250-
object, created = MeetingRegistration.objects.get_or_create(
251-
meeting_id=meeting.pk,
252-
email=address,
253-
)
254-
object.first_name=first_name[:200]
255-
object.last_name=last_name[:200]
256-
object.affiliation=affiliation
257-
object.country_code=country_code
258-
object.save()
250+
matching = MeetingRegistration.objects.filter(meeting_id=meeting.pk, email=address)
251+
if matching.exists():
252+
object = matching.first()
253+
created = False
254+
else:
255+
object = MeetingRegistration.objects.create(meeting_id=meeting.pk, email=address)
256+
object.first_name=first_name[:200]
257+
object.last_name=last_name[:200]
258+
object.affiliation=affiliation
259+
object.country_code=country_code
260+
object.attended = True
261+
object.save()
262+
created = True
259263

260264
# Add a Person object to MeetingRegistration object
261265
# if valid email is available

0 commit comments

Comments
 (0)