Delete old "license" checking code arounds user counts
This is legacy code that doesn't actually do anything of value
This commit is contained in:
parent
a74e94fb67
commit
b7fc7999c3
4 changed files with 3 additions and 29 deletions
|
@ -12,7 +12,7 @@ from data.database import (User, LoginService, FederatedLogin, RepositoryPermiss
|
|||
UserRegion, ImageStorageLocation)
|
||||
from data.model import (DataModelException, InvalidPasswordException, InvalidRobotException,
|
||||
InvalidUsernameException, InvalidEmailAddressException,
|
||||
TooManyUsersException, TooManyLoginAttemptsException, db_transaction,
|
||||
TooManyLoginAttemptsException, db_transaction,
|
||||
notification, config, repository, _basequery)
|
||||
from util.names import format_robot_username, parse_robot_username
|
||||
from util.validation import (validate_username, validate_email, validate_password,
|
||||
|
@ -31,18 +31,11 @@ def hash_password(password, salt=None):
|
|||
return bcrypt.hashpw(password.encode('utf-8'), salt)
|
||||
|
||||
|
||||
def is_create_user_allowed():
|
||||
return True
|
||||
|
||||
|
||||
def create_user(username, password, email, auto_verify=False):
|
||||
""" Creates a regular user, if allowed. """
|
||||
if not validate_password(password):
|
||||
raise InvalidPasswordException(INVALID_PASSWORD_MESSAGE)
|
||||
|
||||
if not is_create_user_allowed():
|
||||
raise TooManyUsersException()
|
||||
|
||||
created = create_user_noverify(username, email)
|
||||
created.password_hash = hash_password(password)
|
||||
created.verified = auto_verify
|
||||
|
@ -307,9 +300,6 @@ def list_entity_robot_permission_teams(entity_name, include_permissions=False):
|
|||
|
||||
def create_federated_user(username, email, service_name, service_ident,
|
||||
set_password_notification, metadata={}):
|
||||
if not is_create_user_allowed():
|
||||
raise TooManyUsersException()
|
||||
|
||||
new_user = create_user_noverify(username, email)
|
||||
new_user.verified = True
|
||||
new_user.save()
|
||||
|
|
Reference in a new issue