Skip to content

Commit

Permalink
Restore model_class for creating user as this code is shared with Too…
Browse files Browse the repository at this point in the history
…lshed
  • Loading branch information
davelopez committed Jun 12, 2024
1 parent b89cb42 commit 0258be8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/managers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def create(self, email=None, username=None, password=None, **kwargs):
Create a new user.
"""
self._error_on_duplicate_email(email)
user = User(email=email)
user = self.model_class(email=email)
if password:
user.set_password_cleartext(password)
else:
Expand All @@ -148,7 +148,7 @@ def create(self, email=None, username=None, password=None, **kwargs):
session.add(user)
try:
# Creating a private role will commit the session
user.attempt_create_private_role()
self.app.security_agent.create_user_role(user, self.app)
except exc.IntegrityError as db_err:
raise exceptions.Conflict(str(db_err))
return user
Expand Down

0 comments on commit 0258be8

Please sign in to comment.