fix: migrate missing registration records - #11288
Conversation
rpcross
commented
Jul 23, 2026
jennifer-richards
left a comment
There was a problem hiding this comment.
Couple style nits to take or leave, plus one question
| meeting_ids = [ | ||
| m.pk | ||
| for m in Meeting.objects.filter(type="ietf") | ||
| if m.number.isdigit() and int(m.number) in numbers |
There was a problem hiding this comment.
Mostly moot given the smallish number of meetings of type "ietf", but it'd be better practice to turn this around:
meetings = Meeting.objects.filter(type="ietf", number__in=[str(num) for num in numbers])I won't insist, though. If you do this, you'd need to change your meeting_id__in filters later to meeting__in to work with the queryset.
| collision_keys.add(key) | ||
| reg = added.get(key + name) | ||
| if reg is None: | ||
| reg = added[key + name] = Registration.objects.create( |
There was a problem hiding this comment.
Style nit: the a = b = ... syntax can be confusing and is relatively uncommon in Python. Consider splitting into two statements.
| removed = 0 | ||
| for key in collision_keys: | ||
| for reg in surviving.get(key, []): | ||
| extra = list(reg.tickets.order_by("id")[1:]) |
There was a problem hiding this comment.
Is the first ticket always the correct one (correct attendance type / ticket type)? Is there always only one to keep?
| key = (meeting_id, norm(email)) | ||
| agg = legacy.get(key) | ||
| if agg is None: | ||
| agg = legacy[key] = { |
There was a problem hiding this comment.
again - a = b = ... style nit