Skip to content
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

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

rpcross
Copy link
Collaborator

@rpcross rpcross commented Oct 30, 2023

Fixes #6265

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

Merging #6567 (de8f9f9) into main (6d87279) will increase coverage by 0.02%.
Report is 21 commits behind head on main.
The diff coverage is 90.00%.

@@            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     
Files Coverage Δ
ietf/meeting/utils.py 89.59% <100.00%> (+1.09%) ⬆️
ietf/nomcom/utils.py 91.40% <100.00%> (-0.03%) ⬇️
ietf/meeting/views.py 91.15% <81.81%> (+0.09%) ⬆️

... and 11 files with indirect coverage changes

@rjsparks
Copy link
Member

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.

Copy link
Member

@jennifer-richards jennifer-richards left a 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))
Copy link
Member

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.

@@ -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):
Copy link
Member

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

Copy link
Member

@rjsparks rjsparks left a 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.

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))
Copy link
Member

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)

Copy link
Collaborator Author

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.

Copy link
Member

@rjsparks rjsparks left a 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.

Comment on lines 2779 to 2796
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)


Copy link
Member

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.

@rjsparks rjsparks merged commit 2974e81 into ietf-tools:main Nov 7, 2023
9 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some meeting participants listed twice on attendees list in proceedings
3 participants