diff --git a/rhodecode/model/user.py b/rhodecode/model/user.py --- a/rhodecode/model/user.py +++ b/rhodecode/model/user.py @@ -26,13 +26,13 @@ import logging import traceback import datetime -from pylons import url from pylons.i18n.translation import _ import ipaddress from sqlalchemy.exc import DatabaseError from sqlalchemy.sql.expression import true, false +from rhodecode.events import UserPreCreate, UserPreUpdate from rhodecode.lib.utils2 import ( safe_unicode, get_current_rhodecode_user, action_logger_generic, AttributeDict) @@ -270,10 +270,12 @@ class UserModel(BaseModel): # raises UserCreationError if it's not allowed for any reason to # create new active user, this also executes pre-create hooks check_allowed_create_user(user_data, cur_user, strict_check=True) + self.send_event(UserPreCreate(user_data)) new_user = User() edit = False else: log.debug('updating user %s', username) + self.send_event(UserPreUpdate(user, user_data)) new_user = user edit = True