Fix bug in materials page introduced in previous commit with non-WG groups

- Legacy-Id: 17124
This commit is contained in:
Ole Laursen 2019-12-05 18:11:24 +00:00
parent 3957743b85
commit defc50caf5
2 changed files with 6 additions and 2 deletions

View file

@ -940,6 +940,10 @@ class Session(models.Model):
def drafts(self):
return list(self.materials.filter(type='draft'))
# The utilities below are used in the proceedings and materials
# templates, and should be moved there - then we could also query
# out the needed information in a few passes and speed up those
# pages.
def all_meeting_sessions_for_group(self):
from ietf.meeting.utils import add_event_info_to_session_qs
if self.group.type_id in ['wg','rg','ag']:

View file

@ -138,10 +138,10 @@ def materials(request, num=None):
schedule = get_schedule(meeting, None)
sessions = Session.objects.filter(
sessions = add_event_info_to_session_qs(Session.objects.filter(
meeting__number=meeting.number,
timeslotassignments__schedule=schedule
).distinct().select_related('meeting__schedule', 'group__state', 'group__parent')
).distinct().select_related('meeting__schedule', 'group__state', 'group__parent'))
plenaries = sessions.filter(name__icontains='plenary')
ietf = sessions.filter(group__parent__type__slug = 'area').exclude(group__acronym='edu')