# HG changeset patch # User Marcin Kuzminski # Date 2020-01-14 15:15:54 # Node ID 4c53d11880a6fd73e2b0d4d9c3b8785396d077ff # Parent 223669578fdcdd5ae0bfd330623af72980e1ba06 audit-logger: use copy of params we later modify to prevent from modification by the store function of parameters that we only use for reading. diff --git a/rhodecode/lib/audit_logger.py b/rhodecode/lib/audit_logger.py --- a/rhodecode/lib/audit_logger.py +++ b/rhodecode/lib/audit_logger.py @@ -151,20 +151,22 @@ def _store_log(action_name, action_data, def store_web(*args, **kwargs): - if 'action_data' not in kwargs: - kwargs['action_data'] = {} - kwargs['action_data'].update({ - 'source': SOURCE_WEB - }) + action_data = {} + org_action_data = kwargs.pop('action_data', {}) + action_data.update(org_action_data) + action_data['source'] = SOURCE_WEB + kwargs['action_data'] = action_data + return store(*args, **kwargs) def store_api(*args, **kwargs): - if 'action_data' not in kwargs: - kwargs['action_data'] = {} - kwargs['action_data'].update({ - 'source': SOURCE_API - }) + action_data = {} + org_action_data = kwargs.pop('action_data', {}) + action_data.update(org_action_data) + action_data['source'] = SOURCE_API + kwargs['action_data'] = action_data + return store(*args, **kwargs)