Skip to content

Commit d82b8bf

Browse files
committed
Reverted one of the changes in [13296], and added a comment explaining the relationship between the role list in roles_for_group_type() and the fields in the following GroupForm.
- Legacy-Id: 13297 Note: SVN reference [13296] has been migrated to Git commit a59331d
1 parent a59331d commit d82b8bf

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

ietf/group/utils.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,3 @@ def construct_group_menu_context(request, group, selected, group_type, others):
242242
d.update(others)
243243

244244
return d
245-
246-
247-
def roles_for_group_type(group_type):
248-
roles = ["chair", "secr", "techadv", "delegate", ]
249-
if group_type == "dir":
250-
roles.append("reviewer")
251-
return roles
252-

ietf/group/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@
5959
from ietf.name.models import GroupTypeName
6060
from ietf.group.utils import (get_charter_text, can_manage_group_type,
6161
milestone_reviewer_for_group_type, can_provide_status_update,
62-
can_manage_materials, get_group_or_404, roles_for_group_type,
62+
can_manage_materials, get_group_or_404,
6363
construct_group_menu_context, get_group_materials)
64+
from ietf.group.views_edit import roles_for_group_type
6465
from ietf.community.utils import docs_tracked_by_community_list
6566
from ietf.community.models import CommunityList, EmailSubscription
6667
from ietf.utils.pipe import pipe

ietf/group/views_edit.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from ietf.group.models import ( Group, Role, GroupEvent, GroupHistory, GroupStateName,
1818
GroupStateTransitions, GroupTypeName, GroupURL, ChangeStateGroupEvent )
1919
from ietf.group.utils import (save_group_in_history, can_manage_group, can_manage_group_type,
20-
get_group_or_404, setup_default_community_list_for_group, roles_for_group_type, )
20+
get_group_or_404, setup_default_community_list_for_group, )
2121
from ietf.ietfauth.utils import has_role
2222
from ietf.person.fields import SearchableEmailsField
2323
from ietf.person.models import Person, Email
@@ -26,6 +26,16 @@
2626
from ietf.utils.text import strip_suffix
2727

2828

29+
# This function, in addition to encapsulating a group's roles list for
30+
# readability, also ensures that the roles with edit buttons in forms
31+
# are the same which are accepted byt the GroupForm. Please adjust the
32+
# list here if you change the *_roles fields the GroupForm knows about.
33+
def roles_for_group_type(group_type):
34+
roles = ["chair", "secr", "techadv", "delegate", ]
35+
if group_type == "dir":
36+
roles.append("reviewer")
37+
return roles
38+
2939
MAX_GROUP_DELEGATES = 3
3040

3141
class GroupForm(forms.Form):

0 commit comments

Comments
 (0)