Merged [7734] from rcross@amsl.com: changes to support IAB group types, including requesting a session and uploading materials.

- Legacy-Id: 7762
Note: SVN reference [7734] has been migrated to Git commit ed53dfdf78
This commit is contained in:
Henrik Levkowetz 2014-05-20 20:21:42 +00:00
commit 0baf1899d8
4 changed files with 20 additions and 8 deletions

View file

@ -50,6 +50,7 @@ def has_role(user, role_names, *args, **kwargs):
"IETF Chair": Q(person=person, name="chair", group__acronym="ietf"),
"IRTF Chair": Q(person=person, name="chair", group__acronym="irtf"),
"IAB Chair": Q(person=person, name="chair", group__acronym="iab"),
"IAB Group Chair": Q(person=person, name="chair", group__type="iab", group__state="active"),
"WG Chair": Q(person=person,name="chair", group__type="wg", group__state="active"),
"WG Secretary": Q(person=person,name="secr", group__type="wg", group__state="active"),
"RG Chair": Q(person=person,name="chair", group__type="rg", group__state="active"),

View file

@ -45,8 +45,8 @@ class SecAuthMiddleware(object):
if request.path.startswith('/secr/announcement/'):
return login_required(view_func)(request,*view_args,**view_kwargs)
elif self.is_unrestricted_url(request.path):
return role_required('WG Chair','WG Secretary','RG Chair','Area Director',
'Secretariat')(view_func)(request,*view_args,**view_kwargs)
return role_required('WG Chair','WG Secretary','RG Chair','IAB Group Chair',
'Area Director','Secretariat')(view_func)(request,*view_args,**view_kwargs)
else:
return role_required('Secretariat')(view_func)(request,*view_args,**view_kwargs)
else:

View file

@ -671,11 +671,21 @@ def select(request, meeting_num):
else:
irtf_form = None
# initialize Training form, this select widget needs to have a session id, because it's
# utilmately the session that we associate material with
if has_role(user,'Secretariat'):
ss = ScheduledSession.objects.filter(schedule=meeting.agenda,timeslot__type='other')
choices = [ (i.session.id, i.session.name) for i in sorted(ss,key=lambda x: x.session.name) ]
# initialize Training form, this select widget needs to have a session id, because
# it's utilmately the session that we associate material with
other_groups = filter(lambda x: x.type_id not in ('wg','ag','rg'),groups_session)
if other_groups:
add_choices = []
sessions = Session.objects.filter(meeting=meeting,group__in=other_groups)
for session in sessions:
if session.name.lower().find('plenary') != -1:
continue
if session.name:
name = (session.name[:75] + '..') if len(session.name) > 75 else session.name
add_choices.append((session.id,name))
else:
add_choices.append((session.id,session.group.name))
choices = sorted(add_choices,key=lambda x: x[1])
training_form = GroupSelectForm(choices=choices)
else:
training_form = None

View file

@ -49,8 +49,9 @@ def get_my_groups(user,conclude=False):
states = ['bof','proposed','active']
if conclude:
states.extend(['conclude','bof-conc'])
all_groups = Group.objects.filter(type__in=('wg','rg','ag','team'),state__in=states).order_by('acronym')
types = ['wg','rg','ag','team','iab']
all_groups = Group.objects.filter(type__in=types,state__in=states).order_by('acronym')
if user == None or has_role(user,'Secretariat'):
return all_groups