Merged in [11708] from rcross@amsl.com:
Restrict session request options to groups of type WG,RG or AG. Add new mailtrigger to names fixture.
- Legacy-Id: 11716
Note: SVN reference [11708] has been migrated to Git commit 10baa54a07
This commit is contained in:
commit
d117b9399d
|
@ -498,7 +498,7 @@ def main(request):
|
||||||
return redirect('sessions_new', acronym=request.POST['group'])
|
return redirect('sessions_new', acronym=request.POST['group'])
|
||||||
|
|
||||||
meeting = get_meeting()
|
meeting = get_meeting()
|
||||||
scheduled_groups,unscheduled_groups = groups_by_session(request.user, meeting)
|
scheduled_groups,unscheduled_groups = groups_by_session(request.user, meeting, types=['wg','rg','ag'])
|
||||||
|
|
||||||
# warn if there are no associated groups
|
# warn if there are no associated groups
|
||||||
if not scheduled_groups and not unscheduled_groups:
|
if not scheduled_groups and not unscheduled_groups:
|
||||||
|
|
|
@ -70,11 +70,11 @@ def get_my_groups(user,conclude=False):
|
||||||
|
|
||||||
return list(my_groups)
|
return list(my_groups)
|
||||||
|
|
||||||
def groups_by_session(user, meeting):
|
def groups_by_session(user, meeting, types=None):
|
||||||
'''
|
'''
|
||||||
Takes a Django User object and a Meeting object
|
Takes a Django User object, Meeting object and optionally string of meeting types to
|
||||||
Returns a tuple scheduled_groups, unscheduled groups. sorted lists of those groups that
|
include. Returns a tuple scheduled_groups, unscheduled groups. sorted lists of those
|
||||||
the user has access to, secretariat defaults to all groups
|
groups that the user has access to, secretariat defaults to all groups
|
||||||
If user=None than all groups are returned.
|
If user=None than all groups are returned.
|
||||||
|
|
||||||
For groups with a session, we must include "concluded" groups because we still want to know
|
For groups with a session, we must include "concluded" groups because we still want to know
|
||||||
|
@ -94,4 +94,8 @@ def groups_by_session(user, meeting):
|
||||||
if group.state_id not in ('conclude','bof-conc'):
|
if group.state_id not in ('conclude','bof-conc'):
|
||||||
groups_no_session.append(group)
|
groups_no_session.append(group)
|
||||||
|
|
||||||
|
if types:
|
||||||
|
groups_session = filter(lambda x: x.type_id in types,groups_session)
|
||||||
|
groups_no_session = filter(lambda x: x.type_id in types,groups_no_session)
|
||||||
|
|
||||||
return groups_session, groups_no_session
|
return groups_session, groups_no_session
|
||||||
|
|
Loading…
Reference in a new issue