Skip to content

Commit

Permalink
Only show sessions from the traditional week in the "week view" used …
Browse files Browse the repository at this point in the history
…for customized calendars. Partially addresses #3022 until a more general solution can be constructed.

 - Legacy-Id: 18185
  • Loading branch information
rjsparks committed Jul 16, 2020
1 parent 49c2fa8 commit 55550ce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ietf/meeting/views.py
Expand Up @@ -1198,6 +1198,12 @@ def week_view(request, num=None, name=None, owner=None):
raise Http404

filtered_assignments = schedule.assignments.exclude(timeslot__type__in=['lead','offagenda'])
# Only show assignments from the traditional meeting "week" (Sat-Fri).
# We'll determine this using the saturday before the first scheduled regular session.
first_regular_session_time = meeting.schedule.qs_assignments_with_sessions.filter(session__type_id='regular').order_by('timeslot__time').first().timeslot.time
saturday_before = first_regular_session_time - datetime.timedelta(days=(first_regular_session_time.weekday() - 5)%7)
saturday_after = saturday_before + datetime.timedelta(days=7)
filtered_assignments = filtered_assignments.filter(timeslot__time__gte=saturday_before,timeslot__time__lt=saturday_after)
filtered_assignments = preprocess_assignments_for_agenda(filtered_assignments, meeting)

items = []
Expand Down

0 comments on commit 55550ce

Please sign in to comment.