From 3c95c34b8b7beb85deb796c372cd65786902269e Mon Sep 17 00:00:00 2001 From: tslai Date: Fri, 8 Jan 2021 20:41:56 +0800 Subject: [PATCH] [12.0][FIX] Add sudo() to retrieve record vals --- auditlog/models/rule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auditlog/models/rule.py b/auditlog/models/rule.py index 8b7b459c9..39bd5bafa 100644 --- a/auditlog/models/rule.py +++ b/auditlog/models/rule.py @@ -235,7 +235,7 @@ class AuditlogRule(models.Model): # their values exist in cache. new_values = {} fields_list = rule_model.get_auditlog_fields(self) - for new_record in new_records: + for new_record in new_records.sudo(): new_values.setdefault(new_record.id, {}) for fname, field in new_record._fields.items(): if fname not in fields_list: