From 8512bff4f120410d2ac2d436ceaf52b431d790b9 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 16 Feb 2025 03:02:20 +0930 Subject: [PATCH] fix(core): when saving history, use audit_model for content type ref: #602 #605 --- app/core/mixin/history_save.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/core/mixin/history_save.py b/app/core/mixin/history_save.py index 506013eb1..8c9066562 100644 --- a/app/core/mixin/history_save.py +++ b/app/core/mixin/history_save.py @@ -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, @@ -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, )