Only show sessions from the traditional week in the "week view" used for customized calendars. Partially addresses #3022 until a more general solution can be constructed.
- Legacy-Id: 18185
This commit is contained in:
parent
49c2fa8be2
commit
55550ce9e6
|
@ -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 = []
|
||||
|
|
Loading…
Reference in a new issue