Skip to content

Commit

Permalink
fix(signals): do not crash while loading fixtures
Browse files Browse the repository at this point in the history
The `raw` flag is set while loading fixtures. In those cases we don't
want to mess with data that may not be there yet, which may crash the
loading process
  • Loading branch information
winged committed Dec 2, 2022
1 parent 159f2d3 commit be45eff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions emeis/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ class Meta:

@receiver(pre_save, sender=Scope)
def set_full_name(instance, sender, **kwargs):
if kwargs.get("raw"): # pragma: no cover
# Raw is set while loading fixtures. In those
# cases we don't want to mess with data that
# may not be there yet
return
sep = "\u00bb"

languages = [lang for lang, _ in settings.LANGUAGES]
Expand Down

0 comments on commit be45eff

Please sign in to comment.