mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
ldap: Fix realm_creation=True registration flow.
When creating realm with the ldap backend, the registration flow didn't properly handle some things - the user wouldn't be set as realm admin, initial subscriptions and messages weren't created, and the redirect wasn't happening properly in the case of subdomains.
This commit is contained in:
committed by
Tim Abbott
parent
9ca26e91e0
commit
ed40d37e44
@@ -619,9 +619,12 @@ class ZulipLDAPAuthBackend(ZulipLDAPAuthBackendBase):
|
||||
opts = {} # type: Dict[str, Any]
|
||||
if self._prereg_user:
|
||||
invited_as = self._prereg_user.invited_as
|
||||
realm_creation = self._prereg_user.realm_creation
|
||||
opts['prereg_user'] = self._prereg_user
|
||||
opts['is_realm_admin'] = invited_as == PreregistrationUser.INVITE_AS['REALM_ADMIN']
|
||||
opts['is_realm_admin'] = (
|
||||
invited_as == PreregistrationUser.INVITE_AS['REALM_ADMIN']) or realm_creation
|
||||
opts['is_guest'] = invited_as == PreregistrationUser.INVITE_AS['GUEST_USER']
|
||||
opts['realm_creation'] = realm_creation
|
||||
opts['default_stream_groups'] = get_default_stream_groups(self._realm)
|
||||
|
||||
user_profile = do_create_user(username, None, self._realm, full_name, short_name, **opts)
|
||||
|
||||
Reference in New Issue
Block a user