Don't connect Theme.get_active() to post_migrate()

This fixes an IntegrityError when trying to import or load
for the first time another Theme
pull/27/head
Bruno Alla 2017-08-08 22:25:52 +01:00
parent 74d7dd12bf
commit 948f0ae7ea
2 changed files with 1 additions and 8 deletions

View File

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.apps import AppConfig from django.apps import AppConfig
from django.db.models.signals import post_migrate
class AdminInterfaceConfig(AppConfig): class AdminInterfaceConfig(AppConfig):
@ -10,7 +9,5 @@ class AdminInterfaceConfig(AppConfig):
verbose_name = 'Admin Interface' verbose_name = 'Admin Interface'
def ready(self): def ready(self):
pass
from admin_interface.models import Theme
post_migrate.connect(Theme.post_migrate_handler, sender = self)

View File

@ -12,10 +12,6 @@ from colorfield.fields import ColorField
@python_2_unicode_compatible @python_2_unicode_compatible
class Theme(models.Model): class Theme(models.Model):
@staticmethod
def post_migrate_handler(sender, **kwargs):
Theme.get_active_theme()
@staticmethod @staticmethod
def post_delete_handler(instance, **kwargs): def post_delete_handler(instance, **kwargs):
Theme.get_active_theme() Theme.get_active_theme()