outposts: skip post_save during migrations and unittests

This commit is contained in:
Jens Langhammer 2020-10-16 15:58:28 +02:00
parent 5e2fb6d56e
commit bdc019c7cf
1 changed files with 4 additions and 0 deletions

View File

@ -18,6 +18,10 @@ def post_save_update(sender, instance: Model, **_):
If an OutpostModel, or a model that is somehow connected to an OutpostModel is saved,
we send a message down the relevant OutpostModels WS connection to trigger an update"""
if instance.__module__ == "django.db.migrations.recorder":
return
if instance.__module__ == "__fake__":
return
outpost_post_save.delay(class_to_path(instance.__class__), instance.pk)