diff --git a/sentry_logger/odoo_sentry_client.py b/sentry_logger/odoo_sentry_client.py index 1e18252ac..5cccc0d38 100644 --- a/sentry_logger/odoo_sentry_client.py +++ b/sentry_logger/odoo_sentry_client.py @@ -120,4 +120,13 @@ class OdooClient(Client): event_type, data, date, time_spent, extra, stack, public_key, tags, **kwargs) res['modules'] = dict(res['modules'].items() + self.revnos.items()) + # Sanitize frames from dispatch since they contain passwords + try: + for values in res['exception']['values']: + values['stacktrace']['frames'] = [ + f for f in values['stacktrace']['frames'] + if f.get('function') not in ['dispatch', 'dispatch_rpc'] + ] + except KeyError: + pass return res