Fixed theme switching bug

This commit is contained in:
Fabio Caccamo
2017-05-22 18:56:22 +02:00
parent 4ef14c248a
commit b25cf463eb
2 changed files with 22 additions and 5 deletions
+5 -5
View File
@@ -21,6 +21,9 @@ class Theme(models.Model):
@staticmethod
def post_save_handler(instance, created, **kwargs):
theme = instance
if theme.active:
Theme.objects.exclude( pk = theme.pk ).update( active = False )
Theme.get_active_theme()
@staticmethod
@@ -99,11 +102,8 @@ class Theme(models.Model):
def set_active(self):
Theme.objects.exclude( pk = self.pk ).update( active = False )
if not self.active:
self.active = True
self.save()
self.active = True
self.save()
def set_default_logo(self):