Listen for changes to environment roles and only log update events when something has changed
This commit is contained in:
parent
887c134b25
commit
f21608ef5e
@ -10,7 +10,7 @@ class CSPRole(Enum):
|
||||
NONSENSE_ROLE = "nonsense_role"
|
||||
|
||||
|
||||
class EnvironmentRole(Base, mixins.TimestampsMixin):
|
||||
class EnvironmentRole(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
||||
__tablename__ = "environment_roles"
|
||||
|
||||
id = types.Id()
|
||||
|
@ -52,7 +52,8 @@ class AuditableMixin(object):
|
||||
|
||||
@staticmethod
|
||||
def audit_update(mapper, connection, target):
|
||||
target.create_audit_event(connection, target, ACTION_UPDATE)
|
||||
if AuditableMixin.get_history(target):
|
||||
target.create_audit_event(connection, target, ACTION_UPDATE)
|
||||
|
||||
def get_changes(self):
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user