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"
|
NONSENSE_ROLE = "nonsense_role"
|
||||||
|
|
||||||
|
|
||||||
class EnvironmentRole(Base, mixins.TimestampsMixin):
|
class EnvironmentRole(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
||||||
__tablename__ = "environment_roles"
|
__tablename__ = "environment_roles"
|
||||||
|
|
||||||
id = types.Id()
|
id = types.Id()
|
||||||
|
@ -52,6 +52,7 @@ class AuditableMixin(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def audit_update(mapper, connection, target):
|
def audit_update(mapper, connection, target):
|
||||||
|
if AuditableMixin.get_history(target):
|
||||||
target.create_audit_event(connection, target, ACTION_UPDATE)
|
target.create_audit_event(connection, target, ACTION_UPDATE)
|
||||||
|
|
||||||
def get_changes(self):
|
def get_changes(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user