* Cleanup
This commit is contained in:
parent
c730bdb20c
commit
dd52427ef5
|
|
@ -35,13 +35,14 @@ class GlobalSettings(models.Model):
|
|||
|
||||
def save(self, *args, **kwargs):
|
||||
# Store only one instance of GlobalSettings
|
||||
self.id = 1
|
||||
self.__class__.objects.exclude(id=self.id).delete()
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
InMemoryCache.set('GlobalSettings', self)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f'GlobalSettings for {self.id}'
|
||||
return f'GlobalSettings <{self.id}>'
|
||||
|
||||
@classmethod
|
||||
def load(cls) -> 'GlobalSettings':
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user