Skip to content

Commit

Permalink
fix(apis_entities): disable create_default_uri during fixture loading
Browse files Browse the repository at this point in the history
Fixtures should contain all the data anyway, so the automatic creation
of the default uri should be skipped.

Closes: #1473
  • Loading branch information
b1rger committed Dec 6, 2024
1 parent 5d77912 commit f604816
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apis_core/apis_entities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def get_serialization(self):

@receiver(post_save, dispatch_uid="create_default_uri")
def create_default_uri(sender, instance, created, raw, using, update_fields, **kwargs):
# disable the handler during fixture loading
if raw:
return
create_default_uri = getattr(settings, "CREATE_DEFAULT_URI", True)
skip_default_uri = getattr(instance, "skip_default_uri", False)
if create_default_uri and not skip_default_uri:
Expand Down

0 comments on commit f604816

Please sign in to comment.