Allow creating group with org_id
fixes #164 (closed), #165 (closed), #72 (closed)
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
Owner
-
Owner
👍
fixes #164 (closed), #165 (closed), #72 (closed)
1578 | 1620 | return redirect(savedform.profile.get_absolute_url()) |
1579 | 1621 | |
1580 | 1622 | |
1623 | class GroupProfileUpdate(GroupCodeMixin, LoginRequiredMixin, UpdateView): | |
1624 | ||
1625 | form_class = GroupProfileUpdateForm | |
1626 | model = Group | |
1627 | ||
1628 | @classmethod | |
1629 | def get_available_group_codes(cls, request, extra=None): | |
1630 | result = super(GroupProfileUpdate, cls).get_available_group_codes( | |
1631 | request) | |
1632 | if extra and not extra in result: | |
Please
register
or
sign in
to reply
|
100 | conf = get_config(None, request) | |
101 | client = Saml2Client(conf, state_cache=state, | |
102 | identity_cache=IdentityCache(request.session), | |
103 | logger=logger) | |
104 | subject_id = _get_subject_id(request.session) | |
105 | identity = client.users.get_identity(subject_id, | |
106 | check_not_on_or_after=False) | |
107 | if identity: | |
108 | attributes = identity[0] | |
109 | owneratrs = getattr( | |
110 | settings, 'SAML_GROUP_OWNER_ATTRIBUTES', []) | |
111 | groups = [] | |
112 | for i in owneratrs: | |
113 | try: | |
114 | groups += attributes[i] | |
115 | except KeyError: | |
|