@@ -607,11 +607,11 @@ def agenda_by_type_ics(request,num=None,type=None):
607607 updated = meeting .updated ()
608608 return render (request ,"meeting/agenda.ics" ,{"schedule" :schedule ,"updated" :updated ,"assignments" :assignments },content_type = "text/calendar" )
609609
610- def session_draft_list (num , session ):
610+ def session_draft_list (num , acronym ):
611611 try :
612612 agendas = Document .objects .filter (type = "agenda" ,
613613 session__meeting__number = num ,
614- session__group__acronym = session ,
614+ session__group__acronym = acronym ,
615615 states = State .objects .get (type = "agenda" , slug = "active" )).distinct ()
616616 except Document .DoesNotExist :
617617 raise Http404
@@ -636,18 +636,18 @@ def session_draft_list(num, session):
636636 except Document .DoesNotExist :
637637 pass
638638
639- for sp in SessionPresentation .objects .filter (session__meeting__number = num , session__group__acronym = session , document__type = 'draft' ):
639+ for sp in SessionPresentation .objects .filter (session__meeting__number = num , session__group__acronym = acronym , document__type = 'draft' ):
640640 doc_name = sp .document .name + "-" + sp .document .rev
641641 if doc_name not in result :
642642 result .append (doc_name )
643643
644644 return sorted (result )
645645
646- def session_draft_tarfile (request , num , session ):
647- drafts = session_draft_list (num , session );
646+ def session_draft_tarfile (request , num , acronym ):
647+ drafts = session_draft_list (num , acronym );
648648
649649 response = HttpResponse (content_type = 'application/octet-stream' )
650- response ['Content-Disposition' ] = 'attachment; filename=%s-drafts.tgz' % (session )
650+ response ['Content-Disposition' ] = 'attachment; filename=%s-drafts.tgz' % (acronym )
651651 tarstream = tarfile .open ('' ,'w:gz' ,response )
652652 mfh , mfn = mkstemp ()
653653 os .close (mfh )
@@ -674,8 +674,8 @@ def session_draft_tarfile(request, num, session):
674674 os .unlink (mfn )
675675 return response
676676
677- def session_draft_pdf (request , num , session ):
678- drafts = session_draft_list (num , session );
677+ def session_draft_pdf (request , num , acronym ):
678+ drafts = session_draft_list (num , acronym );
679679 curr_page = 1
680680 pmh , pmn = mkstemp ()
681681 os .close (pmh )
@@ -829,7 +829,7 @@ def room_view(request, num=None, name=None, owner=None):
829829 template = "meeting/room-view.html"
830830 return render (request , template ,{"meeting" :meeting ,"schedule" :schedule ,"unavailable" :unavailable ,"assignments" :assignments ,"rooms" :rooms ,"days" :days })
831831
832- def ical_agenda (request , num = None , name = None , ext = None ):
832+ def ical_agenda (request , num = None , name = None , acronym = None , session_id = None ):
833833 meeting = get_meeting (num )
834834 schedule = get_schedule (meeting , name )
835835 updated = meeting .updated ()
@@ -863,12 +863,18 @@ def ical_agenda(request, num=None, name=None, ext=None):
863863 assignments = schedule .assignments .exclude (timeslot__type__in = ['lead' ,'offagenda' ])
864864 assignments = preprocess_assignments_for_agenda (assignments , meeting )
865865
866- assignments = [a for a in assignments if
866+ if q :
867+ assignments = [a for a in assignments if
867868 (a .timeslot .type_id in include_types
868869 or (a .session .historic_group and a .session .historic_group .acronym in include )
869870 or (a .session .historic_group and a .session .historic_group .historic_parent and a .session .historic_group .historic_parent .acronym in include ))
870871 and (not a .session .historic_group or a .session .historic_group .acronym not in exclude )]
871872
873+ if acronym :
874+ assignments = [ a for a in assignments if a .session .historic_group and a .session .historic_group .acronym == acronym ]
875+ elif session_id :
876+ assignments = [ a for a in assignments if a .session_id == int (session_id ) ]
877+
872878 return render (request , "meeting/agenda.ics" , {
873879 "schedule" : schedule ,
874880 "assignments" : assignments ,
0 commit comments