From 40ea93e00a876bea0225aff2fd04d473ba86d3d7 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Feb 2022 22:06:53 +0100 Subject: [PATCH] catch more explicit --- InvenTree/label/apps.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/InvenTree/label/apps.py b/InvenTree/label/apps.py index 2954d8a407..29da7976d4 100644 --- a/InvenTree/label/apps.py +++ b/InvenTree/label/apps.py @@ -5,6 +5,7 @@ import hashlib from django.apps import AppConfig from django.conf import settings +from django.core.exceptions import AppRegistryNotReady from InvenTree.ready import canAppAccessDatabase @@ -53,7 +54,7 @@ class LabelConfig(AppConfig): try: from .models import StockItemLabel - except: + except AppRegistryNotReady: # pragma: no cover # Database might not by ready yet return @@ -140,7 +141,7 @@ class LabelConfig(AppConfig): try: from .models import StockLocationLabel - except: + except AppRegistryNotReady: # pragma: no cover # Database might not yet be ready return @@ -234,7 +235,7 @@ class LabelConfig(AppConfig): try: from .models import PartLabel - except: + except AppRegistryNotReady: # pragma: no cover # Database might not yet be ready return