Skip to content

Commit 10baa54

Browse files
committed
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
1 parent f630191 commit 10baa54

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

ietf/name/fixtures/names.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5506,6 +5506,17 @@
55065506
"model": "mailtrigger.mailtrigger",
55075507
"pk": "group_personnel_change"
55085508
},
5509+
{
5510+
"fields": {
5511+
"cc": [],
5512+
"to": [
5513+
"iesg_secretary"
5514+
],
5515+
"desc": "Recipients when an interim meeting is approved and an announcement needs to be sent"
5516+
},
5517+
"model": "mailtrigger.mailtrigger",
5518+
"pk": "interim_approved"
5519+
},
55095520
{
55105521
"fields": {
55115522
"cc": [],

ietf/secr/sreq/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def main(request):
498498
return redirect('sessions_new', acronym=request.POST['group'])
499499

500500
meeting = get_meeting()
501-
scheduled_groups,unscheduled_groups = groups_by_session(request.user, meeting)
501+
scheduled_groups,unscheduled_groups = groups_by_session(request.user, meeting, types=['wg','rg','ag'])
502502

503503
# warn if there are no associated groups
504504
if not scheduled_groups and not unscheduled_groups:

ietf/secr/utils/group.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ def get_my_groups(user,conclude=False):
7070

7171
return list(my_groups)
7272

73-
def groups_by_session(user, meeting):
73+
def groups_by_session(user, meeting, types=None):
7474
'''
75-
Takes a Django User object and a Meeting object
76-
Returns a tuple scheduled_groups, unscheduled groups. sorted lists of those groups that
77-
the user has access to, secretariat defaults to all groups
75+
Takes a Django User object, Meeting object and optionally string of meeting types to
76+
include. Returns a tuple scheduled_groups, unscheduled groups. sorted lists of those
77+
groups that the user has access to, secretariat defaults to all groups
7878
If user=None than all groups are returned.
7979
8080
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):
9494
if group.state_id not in ('conclude','bof-conc'):
9595
groups_no_session.append(group)
9696

97+
if types:
98+
groups_session = filter(lambda x: x.type_id in types,groups_session)
99+
groups_no_session = filter(lambda x: x.type_id in types,groups_no_session)
100+
97101
return groups_session, groups_no_session

0 commit comments

Comments
 (0)