From d316c3130cb603b5812c030dabfba3ce06e0a58c Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Thu, 27 Feb 2020 15:35:38 +0100 Subject: [PATCH] Logs are created post save --- apps/logs/signals.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/logs/signals.py b/apps/logs/signals.py index 7bef4f60..ab9b2b29 100644 --- a/apps/logs/signals.py +++ b/apps/logs/signals.py @@ -5,7 +5,7 @@ import inspect from django.contrib.contenttypes.models import ContentType from django.core import serializers -from django.db.models.signals import pre_save, pre_delete +from django.db.models.signals import post_save, post_delete from django.dispatch import receiver from .models import Changelog @@ -58,7 +58,7 @@ EXCLUDED = [ 'reversion.version', ] -@receiver(pre_save) +@receiver(post_save) def save_object(sender, instance, **kwargs): # noinspection PyProtectedMember if instance._meta.label_lower in EXCLUDED: @@ -80,7 +80,7 @@ def save_object(sender, instance, **kwargs): ).save() -@receiver(pre_delete) +@receiver(post_delete) def delete_object(sender, instance, **kwargs): # noinspection PyProtectedMember if instance._meta.label_lower in EXCLUDED: