# HG changeset patch # User Johannes Bornhold # Date 2016-05-31 10:37:59 # Node ID d4ffc03ca60b922d03cfdf238ac6a2f2d6201208 # Parent 8af8d224f57a78f5035386eb9d80e66b2de1c62f events: Add user data to UserPreCreate und UserPreUpdate events. diff --git a/rhodecode/events.py b/rhodecode/events.py --- a/rhodecode/events.py +++ b/rhodecode/events.py @@ -38,8 +38,8 @@ class UserPreCreate(object): An instance of this class is emitted as an :term:`event` before a new user object is created. """ - def __init__(self, active): - self.active = active + def __init__(self, user_data): + self.user_data = user_data @implementer(IUserPreUpdate) @@ -48,6 +48,6 @@ class UserPreUpdate(object): An instance of this class is emitted as an :term:`event` before a user object is updated. """ - def __init__(self, user, active): + def __init__(self, user, user_data): self.user = user - self.active = active + self.user_data = user_data diff --git a/rhodecode/interfaces.py b/rhodecode/interfaces.py --- a/rhodecode/interfaces.py +++ b/rhodecode/interfaces.py @@ -30,9 +30,9 @@ class IUserRegistered(Interface): class IUserPreCreate(Interface): """ - An event type that is emitted before a new user object is persisted. + An event type that is emitted before a new user object is created. """ - active = Attribute('Value for user.active') + user_data = Attribute('Data used to create the new user') class IUserPreUpdate(Interface): @@ -40,4 +40,4 @@ class IUserPreUpdate(Interface): An event type that is emitted before a user object is updated. """ user = Attribute('The not yet updated user object') - active = Attribute('New value for user.active') + user_data = Attribute('Data used to update the user')