Commit 457d458 1 parent f4e4105 commit 457d458 Copy full SHA for 457d458
File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,12 @@ def create_audit_log_from_historical_record(
84
84
85
85
environment , project = instance .get_environment_and_project ()
86
86
87
+ related_object_id = instance .get_audit_log_related_object_id (history_instance )
88
+ related_object_type = instance .get_audit_log_related_object_type (history_instance )
89
+
90
+ if not related_object_id :
91
+ return
92
+
87
93
log_message = {
88
94
"+" : instance .get_create_log_message ,
89
95
"-" : instance .get_delete_log_message ,
@@ -93,7 +99,7 @@ def create_audit_log_from_historical_record(
93
99
related_object_id = instance .get_audit_log_related_object_id (history_instance )
94
100
related_object_type = instance .get_audit_log_related_object_type (history_instance )
95
101
96
- if not ( log_message and related_object_id ) :
102
+ if not log_message :
97
103
return
98
104
99
105
AuditLog .objects .create (
You can’t perform that action at this time.
0 commit comments