Skip to content

Commit d117b93

Browse files
committed
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 10baa54
2 parents eb92924 + 10baa54 commit d117b93

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

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)