From 00a4e5934b86625aeed612e40b276c85b59f6036 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 16 Jan 2022 17:07:45 +0100 Subject: [PATCH] Try to fix postgres/mysql test suite error --- evennia/utils/create.py | 4 ++-- evennia/utils/search.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/evennia/utils/create.py b/evennia/utils/create.py index 19a5c4c5b3..db45ff4421 100644 --- a/evennia/utils/create.py +++ b/evennia/utils/create.py @@ -14,7 +14,7 @@ objects already existing in the database. """ -from django.db.utils import OperationalError +from django.db.utils import OperationalError, ProgrammingError from django.contrib.contenttypes.models import ContentType # limit symbol import from API @@ -38,7 +38,7 @@ try: ChannelDB = ContentType.objects.get(app_label="comms", model="channeldb").model_class() HelpEntry = ContentType.objects.get(app_label="help", model="helpentry").model_class() Tag = ContentType.objects.get(app_label="typeclasses", model="tag").model_class() -except OperationalError: +except (OperationalError, ProgrammingError): # this is a fallback used during tests/doc building print("Couldn't initialize create managers - db not set up.") from evennia.objects.models import ObjectDB diff --git a/evennia/utils/search.py b/evennia/utils/search.py index 63dd7fedab..e5b8c7af2f 100644 --- a/evennia/utils/search.py +++ b/evennia/utils/search.py @@ -26,7 +26,7 @@ Example: To reach the search method 'get_object_with_account' # Import the manager methods to be wrapped -from django.db.utils import OperationalError +from django.db.utils import OperationalError, ProgrammingError from django.contrib.contenttypes.models import ContentType # limit symbol import from API @@ -53,7 +53,7 @@ try: ChannelDB = ContentType.objects.get(app_label="comms", model="channeldb").model_class() HelpEntry = ContentType.objects.get(app_label="help", model="helpentry").model_class() Tag = ContentType.objects.get(app_label="typeclasses", model="tag").model_class() -except OperationalError: +except (OperationalError, ProgrammingError): # this is a fallback used during tests/doc building print("Couldn't initialize search managers - db not set up.") from evennia.objects.models import ObjectDB