diff --git a/ietf/meeting/tests_views.py b/ietf/meeting/tests_views.py index d6bbf291fd..4db7622132 100644 --- a/ietf/meeting/tests_views.py +++ b/ietf/meeting/tests_views.py @@ -7856,7 +7856,7 @@ def test_proceedings_attendees(self): """ make_meeting_test_data() - meeting = MeetingFactory(type_id='ietf', date=datetime.date(2016, 7, 14), number="97") + meeting = MeetingFactory(type_id='ietf', date=datetime.date(2023, 11, 4), number="118") person_a = PersonFactory(name='Person A') person_b = PersonFactory(name='Person B') person_c = PersonFactory(name='Person C') @@ -7868,7 +7868,7 @@ def test_proceedings_attendees(self): MeetingRegistrationFactory(meeting=meeting, person=person_c, reg_type='remote') AttendedFactory(session__meeting=meeting, session__type_id='plenary', person=person_c) MeetingRegistrationFactory(meeting=meeting, person=person_d, reg_type='remote') - url = urlreverse('ietf.meeting.views.proceedings_attendees',kwargs={'num': 97}) + url = urlreverse('ietf.meeting.views.proceedings_attendees',kwargs={'num': 118}) response = self.client.get(url) self.assertContains(response, 'Attendee list') q = PyQuery(response.content) @@ -8284,4 +8284,4 @@ def test_participants_for_meeting(self): 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) \ No newline at end of file + self.assertTrue(person_d.pk not in attended) diff --git a/ietf/meeting/views.py b/ietf/meeting/views.py index 75444c5700..e97e8a7ebd 100644 --- a/ietf/meeting/views.py +++ b/ietf/meeting/views.py @@ -3861,18 +3861,29 @@ def proceedings_attendees(request, num=None): if meeting.proceedings_format_version == 1: return HttpResponseRedirect(f'{settings.PROCEEDINGS_V1_BASE_URL.format(meeting=meeting)}/attendee.html') - checked_in, attended = participants_for_meeting(meeting) - regs = list(MeetingRegistration.objects.filter(meeting__number=num, reg_type='onsite', checkedin=True)) + template = None + meeting_registrations = None - for mr in MeetingRegistration.objects.filter(meeting__number=num, reg_type='remote').select_related('person'): - if mr.person.pk in attended and mr.person.pk not in checked_in: - regs.append(mr) + if int(meeting.number) >= 118: + checked_in, attended = participants_for_meeting(meeting) + regs = list(MeetingRegistration.objects.filter(meeting__number=num, reg_type='onsite', checkedin=True)) - meeting_registrations = sorted(regs, key=lambda x: (x.last_name, x.first_name)) + for mr in MeetingRegistration.objects.filter(meeting__number=num, reg_type='remote').select_related('person'): + 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)) + else: + overview_template = "/meeting/proceedings/%s/attendees.html" % meeting.number + try: + template = render_to_string(overview_template, {}) + except TemplateDoesNotExist: + raise Http404 return render(request, "meeting/proceedings_attendees.html", { 'meeting': meeting, 'meeting_registrations': meeting_registrations, + 'template': template, }) def proceedings_overview(request, num=None): diff --git a/ietf/templates/meeting/proceedings_attendees.html b/ietf/templates/meeting/proceedings_attendees.html index 3516bc7ee4..6c51a4546e 100644 --- a/ietf/templates/meeting/proceedings_attendees.html +++ b/ietf/templates/meeting/proceedings_attendees.html @@ -15,29 +15,32 @@

Attendee list of IETF {{ meeting.number }} meeting

- - - - - - - - - - - - {% for reg in meeting_registrations %} - - - - - - - - {% endfor %} - -
Last NameFirst NameOrganizationCountryRegistration Type
{{ reg.last_name }}{{ reg.first_name }}{{ reg.affiliation }}{{ reg.country_code }}{{ reg.reg_type }}
- + {% if template %} + {{template|safe}} + {% else %} + + + + + + + + + + + + {% for reg in meeting_registrations %} + + + + + + + + {% endfor %} + +
Last NameFirst NameOrganizationCountryRegistration Type
{{ reg.last_name }}{{ reg.first_name }}{{ reg.affiliation }}{{ reg.country_code }}{{ reg.reg_type }}
+ {% endif %} {% endblock %} {% block js %}