mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-22 08:38:29 +02:00
Don't trigger signals on raw imports
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -34,13 +34,13 @@ def pre_save_object(sender, instance, **kwargs):
|
||||
instance._previous = None
|
||||
|
||||
|
||||
def save_object(sender, instance, **kwargs):
|
||||
def save_object(sender, instance, raw, **kwargs):
|
||||
"""
|
||||
Each time a model is saved, an entry in the table `Changelog` is added in the database
|
||||
in order to store each modification made
|
||||
"""
|
||||
# noinspection PyProtectedMember
|
||||
if instance._meta.label_lower in EXCLUDED or hasattr(instance, "_no_signal"):
|
||||
if instance._meta.label_lower in EXCLUDED or hasattr(instance, "_no_signal") or raw:
|
||||
return
|
||||
|
||||
# noinspection PyProtectedMember
|
||||
|
Reference in New Issue
Block a user