Restrict session request options to groups of type WG,RG or AG. Add new mailtrigger to names fixture. Commit ready for merge.

- Legacy-Id: 11708
This commit is contained in:
Ryan Cross 2016-07-18 11:39:36 +00:00
parent f6301913f6
commit 10baa54a07
3 changed files with 20 additions and 5 deletions

View file

@ -5506,6 +5506,17 @@
"model": "mailtrigger.mailtrigger",
"pk": "group_personnel_change"
},
{
"fields": {
"cc": [],
"to": [
"iesg_secretary"
],
"desc": "Recipients when an interim meeting is approved and an announcement needs to be sent"
},
"model": "mailtrigger.mailtrigger",
"pk": "interim_approved"
},
{
"fields": {
"cc": [],

View file

@ -498,7 +498,7 @@ def main(request):
return redirect('sessions_new', acronym=request.POST['group'])
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
if not scheduled_groups and not unscheduled_groups:

View file

@ -70,11 +70,11 @@ def get_my_groups(user,conclude=False):
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
Returns a tuple scheduled_groups, unscheduled groups. sorted lists of those groups that
the user has access to, secretariat defaults to all groups
Takes a Django User object, Meeting object and optionally string of meeting types to
include. Returns a tuple scheduled_groups, unscheduled groups. sorted lists of those
groups that the user has access to, secretariat defaults to all groups
If user=None than all groups are returned.
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'):
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