Catch a ProgrammingError if table does not exist

This commit is contained in:
Oliver Walters 2020-02-18 10:44:01 +11:00
parent f03f6c4386
commit 066d69215f

View File

@ -1,5 +1,5 @@
from django.apps import AppConfig
from django.db.utils import OperationalError
from django.db.utils import OperationalError, ProgrammingError
import os
@ -43,6 +43,6 @@ class CommonConfig(AppConfig):
setting.save()
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
break