diff --git a/shimatta_kenkyusho/parts/models.py b/shimatta_kenkyusho/parts/models.py index ee10485..47ea19c 100644 --- a/shimatta_kenkyusho/parts/models.py +++ b/shimatta_kenkyusho/parts/models.py @@ -376,6 +376,12 @@ def auto_apply_template_structure(sender, instance, created, **kwargs): If there are nested sub-storages these will be added when the sub-storages are created automatically. """ + + # Skip recursion if the model is saved 'raw' e.g. when imported + if 'raw' in kwargs: + if kwargs['raw']: + return + if created: if instance.template: for sub_storage in instance.template.storage_set.all():