Merge pull request 'Fix #24: Solve recursion bug when importing templates from a fixture' (#29) from bugfix/24-fix-template-import-recursion-bug into develop

Reviewed-on: #29
This commit is contained in:
Stefan Strobel 2024-11-24 21:25:30 +01:00
commit 46a94c9688

View File

@ -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():