diff --git a/store/models.py b/store/models.py index 510bd91..6cdf705 100644 --- a/store/models.py +++ b/store/models.py @@ -23,9 +23,7 @@ from django_cleanup import cleanup from mptt.fields import TreeForeignKey from mptt.models import MPTTModel -from external_api.currency import client as CurrencyAPIClient from store.utils import create_preview, concat_not_null_values -from utils.cache import InMemoryCache class GlobalSettings(models.Model): @@ -51,19 +49,12 @@ class GlobalSettings(models.Model): self.__class__.objects.exclude(id=self.id).delete() super().save(*args, **kwargs) - InMemoryCache.set('GlobalSettings', self) - def __str__(self) -> str: return f'GlobalSettings <{self.id}>' @classmethod def load(cls) -> 'GlobalSettings': - cached = InMemoryCache.get('GlobalSettings') - if cached: - return cached - obj, _ = cls.objects.get_or_create(id=1) - InMemoryCache.set('GlobalSettings', obj) return obj @property