Skip to content

Commit

Permalink
fix(core): when saving history, use audit_model for content type
Browse files Browse the repository at this point in the history
ref: #602 #605
  • Loading branch information
jon-nfc committed Feb 17, 2025
1 parent 507db10 commit 8512bff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/core/mixin/history_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ def save_history(self, before: dict, after: dict, history_model = None) -> bool:
action = action,
user = current_user,
content_type = ContentType.objects.get(
app_label= self._meta.app_label,
model = self._meta.model_name
app_label= parent_model._meta.app_label,
model = parent_model._meta.model_name
),
model = parent_model,
child_model = audit_model,
Expand All @@ -184,8 +184,8 @@ def save_history(self, before: dict, after: dict, history_model = None) -> bool:
action = action,
user = current_user,
content_type = ContentType.objects.get(
app_label= self._meta.app_label,
model = self._meta.model_name
app_label= audit_model._meta.app_label,
model = audit_model._meta.model_name
),
model = audit_model,
)
Expand Down

0 comments on commit 8512bff

Please sign in to comment.