-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: build proceedings attendee list from MeetingRegistration table. … #6567
Conversation
Codecov Report
@@ Coverage Diff @@
## main #6567 +/- ##
==========================================
+ Coverage 88.85% 88.88% +0.02%
==========================================
Files 284 285 +1
Lines 40253 40283 +30
==========================================
+ Hits 35767 35804 +37
+ Misses 4486 4479 -7
|
This leaves some abandoned dbtemplates - it's reasonable to leave them in place in the short term should we need to fall back, but we'll need to track an action to remove them. Leaving this comment as a note to create an issue to track that task when this PR is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a couple comments inline, but I think this is ok, assuming the duplicate MeetingRegistration
data get cleaned up.
If the older data likely have similar issues, de-duplicating the records before displaying them would be something to consider. That would probably need to be paired with another method for detecting the problem, though, so that duplicates are not simply swept under the rug.
if mr.person.pk in attended and mr.person.pk not in checked_in: | ||
regs.append(mr) | ||
|
||
meeting_registrations = sorted(regs, key=lambda x: (x.last_name, x.first_name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bummer that first/last name is baked in here (and presumably deeper in the registration). If sorting these comes up again, it'd probably be worth factoring out a method to sort by name.
ietf/nomcom/utils.py
Outdated
@@ -678,6 +678,16 @@ def three_of_five_eligible_8713(previous_five, queryset=None): | |||
queryset = Person.objects.all() | |||
return queryset.filter(meetingregistration__meeting__in=list(previous_five),meetingregistration__attended=True).annotate(mtg_count=Count('meetingregistration')).filter(mtg_count__gte=3) | |||
|
|||
def participants_for_meeting(meeting): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this helper belongs in ietf.meeting
instead of ietf.nomcom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jennifer's comments cause me to think about method signatures as well, and I do want some changes before we merge this.
ietf/nomcom/utils.py
Outdated
checked_in = meeting.meetingregistration_set.filter(reg_type='onsite', checkedin=True).values_list('person', flat=True) | ||
sessions = meeting.session_set.filter(Q(type='plenary') | Q(group__type__in=['wg', 'rg'])) | ||
attended = Attended.objects.filter(session__in=sessions).values_list('person', flat=True) | ||
return (set(checked_in), set(attended)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
evaluating these to sets here is not right - we should return querysets and let whatever called it chose when to evaluate. (I also agree this should move to meeting)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved function and changed to return querysets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry - one more housekeeping change please.
ietf/nomcom/tests.py
Outdated
def test_participants_for_meeting(self): | ||
person_a = PersonFactory() | ||
person_b = PersonFactory() | ||
person_c = PersonFactory() | ||
person_d = PersonFactory() | ||
m = MeetingFactory.create(type_id='ietf') | ||
MeetingRegistrationFactory(meeting=m, person=person_a, reg_type='onsite', checkedin=True) | ||
MeetingRegistrationFactory(meeting=m, person=person_b, reg_type='onsite', checkedin=False) | ||
MeetingRegistrationFactory(meeting=m, person=person_c, reg_type='remote') | ||
MeetingRegistrationFactory(meeting=m, person=person_d, reg_type='remote') | ||
AttendedFactory(session__meeting=m, session__type_id='plenary', person=person_c) | ||
checked_in, attended = participants_for_meeting(m) | ||
self.assertTrue(person_a.pk in checked_in) | ||
self.assertTrue(person_b.pk not in checked_in) | ||
self.assertTrue(person_c.pk in attended) | ||
self.assertTrue(person_d.pk not in attended) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should move to the meeting tests.
…Fixes #6265