Updated meeting attendance and nomcom eligibility calculations to take the MeetingRegistration.attendance flag into account.

- Legacy-Id: 17955
This commit is contained in:
Henrik Levkowetz 2020-06-09 21:00:07 +00:00
parent 8a6026ce6e
commit efcdc4d917
3 changed files with 8 additions and 3 deletions

View file

@ -166,7 +166,12 @@ def finalize(meeting):
return
def attended_ietf_meetings(person):
return Meeting.objects.filter(type='ietf',meetingregistration__email__in=Email.objects.filter(person=person).values_list('address',flat=True))
email_addresses = Email.objects.filter(person=person).values_list('address',flat=True)
return Meeting.objects.filter(
type='ietf',
meetingregistration__email__in=email_addresses,
meetingregistration__attended=True,
)
def attended_in_last_five_ietf_meetings(person, date=datetime.datetime.today()):
previous_five = Meeting.objects.filter(type='ietf',date__lte=date).order_by('-date')[:5]

View file

@ -1821,7 +1821,7 @@ Junk body for testing
if not ' ' in ascii:
continue
first_name, last_name = ascii.rsplit(None, 1)
MeetingRegistration.objects.create(meeting=meeting, first_name=first_name, last_name=last_name, person=person, country_code='WO', email=email)
MeetingRegistration.objects.create(meeting=meeting, first_name=first_name, last_name=last_name, person=person, country_code='WO', email=email, attended=True)
# test the page
url = reverse('ietf.nomcom.views.eligible',kwargs={'year':self.nc.year()})
login_testing_unauthorized(self,self.chair.user.username,url)

View file

@ -1251,7 +1251,7 @@ def eligible(request, year):
attendees = {}
potentials = set()
for m in previous_five:
registration_emails = m.meetingregistration_set.values_list('email',flat=True)
registration_emails = m.meetingregistration_set.filter(attended=True).values_list('email',flat=True)
attendees[m] = Person.objects.filter(email__address__in=registration_emails).distinct()
# See RFC8713 section 4.15
disqualified_roles = Role.objects.filter(DISQUALIFYING_ROLE_QUERY_EXPRESSION)