fixed app hook fix_tree
This commit is contained in:
parent
7aafd9829d
commit
9f1351c84a
@ -1,6 +1,6 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import OperationalError
|
from django.db import OperationalError, ProgrammingError
|
||||||
from django_scopes import scopes_disabled
|
from django_scopes import scopes_disabled
|
||||||
|
|
||||||
|
|
||||||
@ -21,4 +21,6 @@ class CookbookConfig(AppConfig):
|
|||||||
Keyword.fix_tree(fix_paths=True)
|
Keyword.fix_tree(fix_paths=True)
|
||||||
Food.fix_tree(fix_paths=True)
|
Food.fix_tree(fix_paths=True)
|
||||||
except OperationalError:
|
except OperationalError:
|
||||||
pass # if model does not exist there is no need to fix it
|
pass # if model does not exist there is no need to fix it
|
||||||
|
except ProgrammingError:
|
||||||
|
pass # if migration has not been run database cannot be fixed yet
|
||||||
|
Loading…
Reference in New Issue
Block a user