diff --git a/apps/location/models.py b/apps/location/models.py index 578d4939..1948588c 100644 --- a/apps/location/models.py +++ b/apps/location/models.py @@ -1,12 +1,12 @@ """Location app models.""" from django.conf import settings +from django.contrib.gis.db import models +from django.contrib.postgres.fields import JSONField from django.db.models.signals import post_save from django.db.transaction import on_commit from django.dispatch import receiver -from django.contrib.gis.db import models -from django.contrib.postgres.fields import JSONField from django.utils.translation import gettext_lazy as _ -from establishment.tasks import recalculate_price_levels_by_country + from utils.models import ProjectBaseMixin, LocaleManagerMixin, SVGImageMixin @@ -117,6 +117,7 @@ class Address(models.Model): # todo: Make recalculate price levels @receiver(post_save, sender=Country) def run_recalculate_price_levels(sender, instance, **kwargs): + from establishment.tasks import recalculate_price_levels_by_country if settings.USE_CELERY: on_commit(lambda: recalculate_price_levels_by_country.delay( country_id=instance.id))