def user_updated_handler(sender, user, old_data, **kwargs): log_update_object( instance=user, old_data=old_data, fields=kwargs.get('fields'), user=kwargs.get('current_user'), )
def group_updated_handler(sender, group, old_data, **kwargs): log_update_object( instance=group, old_data=old_data, fields=kwargs.get('fields'), user=kwargs.get('user'), )
def environment_updated_handler(sender, environment, old_data, **kwargs): log_update_object( instance=environment, old_data=old_data, fields=kwargs.get('fields'), user=kwargs.get('user'), )
def settings_updated_handler(sender, component, environment, old_settings: dict, new_settings: dict, **kwargs): log_update_object( instance=component, old_data={'settings': { environment.alias: old_settings }}, new_data={'settings': { environment.alias: new_settings }}, user=kwargs.get('user'), )
def component_updated_handler(sender, component, old_data, **kwargs): log_entry = log_update_object( instance=component, old_data=old_data, new_data=kwargs.get('new_data'), fields=kwargs.get('fields'), user=kwargs.get('user'), ) for action, field, values in log_entry.diff_data: if action == dictdiffer.CHANGE and field == 'alias': component_alias_changed.send(sender=Component, component=component, old_alias=values[0], new_alias=values[1])