[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:
2025-09-10 08:29:27 +12:00
parent 4463bf1bc8
commit e82fe7e87e
13 changed files with 146 additions and 5 deletions

View File

@ -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"