Merge pull request #3988 from jsaalfeld/fix_postgres_migration

fixing #3987 - postgreSQL migration possible again
This commit is contained in:
Jochen Saalfeld 2018-11-07 08:34:11 +01:00 committed by GitHub
commit 22d436b6b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ from django.apps import AppConfig
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models.signals import post_migrate
from django.db.utils import OperationalError
from django.db.utils import OperationalError, ProgrammingError
from ..utils.projector import register_projector_elements
@ -53,7 +53,7 @@ class CoreAppConfig(AppConfig):
# Set constants
try:
set_constants(get_constants_from_apps())
except (ImproperlyConfigured, OperationalError):
except (ImproperlyConfigured, OperationalError, ProgrammingError):
# Database is not loaded. This happens in tests and migrations.
pass
@ -81,7 +81,7 @@ class CoreAppConfig(AppConfig):
# Sets the cache
try:
element_cache.ensure_cache()
except (ImproperlyConfigured, OperationalError):
except (ImproperlyConfigured, OperationalError, ProgrammingError):
# This happens in the tests or in migrations. Do nothing
pass