Skip to content

fix: migrate missing registration records - #11288

Open
rpcross wants to merge 2 commits into
ietf-tools:mainfrom
rpcross:fix-regs
Open

fix: migrate missing registration records#11288
rpcross wants to merge 2 commits into
ietf-tools:mainfrom
rpcross:fix-regs

Conversation

@rpcross

@rpcross rpcross commented Jul 23, 2026

Copy link
Copy Markdown
Contributor
For meetings before 100 the legacy stats.MeetingRegistration system allowed
several registrations under one email with different names. The migration to
meeting.Registration keyed on (meeting, email) and kept only one, so the
extra legacy records - which are genuine registrations - were lost. This adds
a Registration for any legacy (meeting, email, name) with no matching row.

The migration also piled the extra legacy rows' tickets onto that single
surviving Registration instead of splitting them across records. For each
such duplicate email this trims the surviving record back to a single ticket
(the recreated registrations get their own tickets above).

@jennifer-richards jennifer-richards left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple style nits to take or leave, plus one question

Comment thread ietf/meeting/utils.py
meeting_ids = [
m.pk
for m in Meeting.objects.filter(type="ietf")
if m.number.isdigit() and int(m.number) in numbers

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread ietf/meeting/utils.py
collision_keys.add(key)
reg = added.get(key + name)
if reg is None:
reg = added[key + name] = Registration.objects.create(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style nit: the a = b = ... syntax can be confusing and is relatively uncommon in Python. Consider splitting into two statements.

Comment thread ietf/meeting/utils.py
removed = 0
for key in collision_keys:
for reg in surviving.get(key, []):
extra = list(reg.tickets.order_by("id")[1:])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the first ticket always the correct one (correct attendance type / ticket type)? Is there always only one to keep?

Comment thread ietf/meeting/utils.py
key = (meeting_id, norm(email))
agg = legacy.get(key)
if agg is None:
agg = legacy[key] = {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again - a = b = ... style nit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants