Skip to content

Commit be81557

Browse files
committed
Shifted building the edit time slices from looking at scheduledsessions to looking at timeslots
- Legacy-Id: 7511
1 parent 0d5a940 commit be81557

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

ietf/meeting/helpers.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,24 @@ def get_area_list_from_sessions(scheduledsessions, num):
6565
'session__group__parent__acronym').distinct().values_list(
6666
'session__group__parent__acronym',flat=True)
6767

68-
def build_all_agenda_slices(scheduledsessions, all = False):
68+
def build_all_agenda_slices(meeting):
6969
time_slices = []
7070
date_slices = {}
7171

72-
for ss in scheduledsessions:
73-
if(all or ss.session != None):# and len(ss.timeslot.session.agenda_note)>1):
74-
ymd = ss.timeslot.time.date()
72+
for ts in meeting.timeslot_set.exclude(type__in=['reg','break']).order_by('time','name'):
73+
ymd = ts.time.date()
7574

76-
if ymd not in date_slices and ss.timeslot.location != None:
75+
if ymd not in date_slices and ts.location != None:
7776
date_slices[ymd] = []
7877
time_slices.append(ymd)
7978

8079
if ymd in date_slices:
81-
if [ss.timeslot.time, ss.timeslot.time+ss.timeslot.duration] not in date_slices[ymd]: # only keep unique entries
82-
date_slices[ymd].append([ss.timeslot.time, ss.timeslot.time+ss.timeslot.duration])
80+
if [ts.time, ts.time+ts.duration] not in date_slices[ymd]: # only keep unique entries
81+
date_slices[ymd].append([ts.time, ts.time+ts.duration])
8382

8483
time_slices.sort()
8584
return time_slices,date_slices
8685

87-
8886
def get_scheduledsessions_from_schedule(schedule):
8987
ss = schedule.scheduledsession_set.filter(timeslot__location__isnull = False).exclude(session__isnull = True).order_by('timeslot__time','timeslot__name','session__group__group')
9088

ietf/meeting/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def edit_agenda(request, num=None, name=None):
287287
# django 1.3+
288288
ad.default_hostscheme = site_base_url
289289

290-
time_slices,date_slices = build_all_agenda_slices(scheduledsessions, True)
290+
time_slices,date_slices = build_all_agenda_slices(meeting)
291291

292292
return HttpResponse(render_to_string("meeting/landscape_edit.html",
293293
{"schedule":schedule,

0 commit comments

Comments
 (0)