Eliminate a lot of the if cases in create_user by separating them out. Add a limit to the number of users which can be created based on the license. Add support for creating and loading licenses.
This commit is contained in:
parent
0ef1902957
commit
33b43b75c0
9 changed files with 103 additions and 26 deletions
|
@ -92,14 +92,12 @@ class LDAPUsers(object):
|
|||
logger.error('Unable to pick a username for user: %s', username)
|
||||
return None
|
||||
|
||||
db_user = model.create_user(valid_username, None, email, add_change_pw_notification=False)
|
||||
db_user.verified = True
|
||||
model.attach_federated_login(db_user, 'ldap', username)
|
||||
db_user = model.create_federated_user(valid_username, email, 'ldap', username,
|
||||
set_password_notification=False)
|
||||
else:
|
||||
# Update the db attributes from ldap
|
||||
db_user.email = email
|
||||
|
||||
db_user.save()
|
||||
db_user.save()
|
||||
|
||||
return db_user
|
||||
|
||||
|
|
Reference in a new issue