signals: disable schedule_pre_save when using loaddata
This commit is contained in:
parent
6e6eb25c96
commit
7b5a37894a
|
@ -41,8 +41,7 @@ def user_default_groups(sender, instance, created, *args, **kwargs):
|
|||
|
||||
@receiver(signals.post_save, sender=Page)
|
||||
def page_post_save(sender, instance, created, *args, **kwargs):
|
||||
return
|
||||
if not created and instance.cover:
|
||||
if not created and instance.cover and "raw" not in kwargs:
|
||||
Page.objects.filter(parent=instance, cover__isnull=True).update(cover=instance.cover)
|
||||
|
||||
|
||||
|
@ -60,8 +59,7 @@ def program_post_save(sender, instance, created, *args, **kwargs):
|
|||
|
||||
@receiver(signals.pre_save, sender=Schedule)
|
||||
def schedule_pre_save(sender, instance, *args, **kwargs):
|
||||
return
|
||||
if getattr(instance, "pk") is not None:
|
||||
if getattr(instance, "pk") is not None and "raw" not in kwargs:
|
||||
instance._initial = Schedule.objects.get(pk=instance.pk)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user