Skip to content

Commit b4e2081

Browse files
committed
Added a log assertion for calls to can_manage_group_type.
- Legacy-Id: 13782
1 parent 6c2331a commit b4e2081

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

ietf/group/utils.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
import debug # pyflakes:ignore
88

9-
from ietf.group.models import Group, RoleHistory, Role
10-
from ietf.person.models import Email
11-
from ietf.utils.history import get_history_object_for, copy_many_to_many_for_history
12-
from ietf.ietfauth.utils import has_role
139
from ietf.community.models import CommunityList, SearchRule
1410
from ietf.community.utils import reset_name_contains_index_for_rule, can_manage_community_list
1511
from ietf.doc.models import Document, State
12+
from ietf.group.models import Group, RoleHistory, Role
13+
from ietf.ietfauth.utils import has_role
14+
from ietf.person.models import Email
1615
from ietf.review.utils import can_manage_review_requests_for_team
17-
16+
from ietf.utils import log
17+
from ietf.utils.history import get_history_object_for, copy_many_to_many_for_history
1818

1919
def save_group_in_history(group):
2020
"""This should be called before saving changes to a Group instance,
@@ -95,6 +95,7 @@ def save_milestone_in_history(milestone):
9595
def can_manage_group_type(user, group, type_id=None):
9696
if type_id is None:
9797
type_id = group.type_id
98+
log.assertion("isinstance(type_id, (type(''), type(u'')))")
9899
if type_id == "rg":
99100
return has_role(user, ('IRTF Chair', 'Secretariat'))
100101
elif type_id == "wg":

0 commit comments

Comments
 (0)