forked from enviPath/enviPy
[Feature] Initial Active Directory / Entra Login (#101)
Co-authored-by: Tim Lorsbach <tim@lorsba.ch> Reviewed-on: enviPath/enviPy#101
This commit is contained in:
@ -153,11 +153,17 @@ class UserManager(object):
|
||||
# avoid circular import :S
|
||||
from .tasks import send_registration_mail
|
||||
|
||||
is_active = not s.ADMIN_APPROVAL_REQUIRED
|
||||
if 'is_active' in kwargs:
|
||||
is_active = kwargs['is_active']
|
||||
extra_fields = {
|
||||
'is_active': not s.ADMIN_APPROVAL_REQUIRED
|
||||
}
|
||||
|
||||
u = get_user_model().objects.create_user(username, email, password, is_active=is_active)
|
||||
if 'is_active' in kwargs:
|
||||
extra_fields['is_active'] = kwargs['is_active']
|
||||
|
||||
if 'uuid' in kwargs:
|
||||
extra_fields['uuid'] = kwargs['uuid']
|
||||
|
||||
u = get_user_model().objects.create_user(username, email, password, **kwargs)
|
||||
|
||||
# Create package
|
||||
package_name = f"{u.username}{'’' if u.username[-1] in 'sxzß' else 's'} Package"
|
||||
|
||||
Reference in New Issue
Block a user