##// END OF EJS Templates
events: Send events when user is created or updated....
johbo -
r230:636c8b2a default
parent child Browse files
Show More
@@ -26,13 +26,13 b' import logging'
26 import traceback
26 import traceback
27
27
28 import datetime
28 import datetime
29 from pylons import url
30 from pylons.i18n.translation import _
29 from pylons.i18n.translation import _
31
30
32 import ipaddress
31 import ipaddress
33 from sqlalchemy.exc import DatabaseError
32 from sqlalchemy.exc import DatabaseError
34 from sqlalchemy.sql.expression import true, false
33 from sqlalchemy.sql.expression import true, false
35
34
35 from rhodecode.events import UserPreCreate, UserPreUpdate
36 from rhodecode.lib.utils2 import (
36 from rhodecode.lib.utils2 import (
37 safe_unicode, get_current_rhodecode_user, action_logger_generic,
37 safe_unicode, get_current_rhodecode_user, action_logger_generic,
38 AttributeDict)
38 AttributeDict)
@@ -270,10 +270,12 b' class UserModel(BaseModel):'
270 # raises UserCreationError if it's not allowed for any reason to
270 # raises UserCreationError if it's not allowed for any reason to
271 # create new active user, this also executes pre-create hooks
271 # create new active user, this also executes pre-create hooks
272 check_allowed_create_user(user_data, cur_user, strict_check=True)
272 check_allowed_create_user(user_data, cur_user, strict_check=True)
273 self.send_event(UserPreCreate(user_data))
273 new_user = User()
274 new_user = User()
274 edit = False
275 edit = False
275 else:
276 else:
276 log.debug('updating user %s', username)
277 log.debug('updating user %s', username)
278 self.send_event(UserPreUpdate(user, user_data))
277 new_user = user
279 new_user = user
278 edit = True
280 edit = True
279
281
General Comments 0
You need to be logged in to leave comments. Login now