Merge pull request #654 from SchrodingersGat/error-fix

Catch a ProgrammingError if table does not exist
This commit is contained in:
Oliver 2020-02-18 11:13:44 +11:00 committed by GitHub
commit 826102e10e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
from django.apps import AppConfig from django.apps import AppConfig
from django.db.utils import OperationalError from django.db.utils import OperationalError, ProgrammingError
import os import os
@ -43,6 +43,6 @@ class CommonConfig(AppConfig):
setting.save() setting.save()
print("Creating new key: '{k}' = '{v}'".format(k=key, v=default)) print("Creating new key: '{k}' = '{v}'".format(k=key, v=default))
except OperationalError: except (OperationalError, ProgrammingError):
# Migrations have not yet been applied - table does not exist # Migrations have not yet been applied - table does not exist
break break