Unverified Commit 0258be88 authored by davelopez's avatar davelopez
Browse files

Restore model_class for creating user as this code is shared with Toolshed

parent b89cb420
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ class UserManager(base.ModelManager, deletable.PurgableManagerMixin):
        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:
@@ -148,7 +148,7 @@ class UserManager(base.ModelManager, deletable.PurgableManagerMixin):
        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