From cb37c8adb81907e870ed60f8f922f6c5d824d176 Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Wed, 20 Nov 2024 08:37:24 +0100 Subject: [PATCH] refactor(history): move import statement into `if` block Only import the `get_generic_triple_table` method if the `apis_core.apis_relations` app is in the list of INSTALLED_APPS. --- apis_core/history/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis_core/history/utils.py b/apis_core/history/utils.py index 3e7531695..44b846912 100644 --- a/apis_core/history/utils.py +++ b/apis_core/history/utils.py @@ -3,7 +3,6 @@ from django.db.models import Q from django_tables2 import RequestConfig -from apis_core.apis_relations.tables import get_generic_triple_table from apis_core.utils.settings import get_entity_settings_by_modelname @@ -18,6 +17,7 @@ def triple_sidebar_history(obj: object, request, detail=True): ) content_type = ContentType.objects.get_for_model(obj.instance_type) if "apis_core.apis_relations" in settings.INSTALLED_APPS: + from apis_core.apis_relations.tables import get_generic_triple_table from apis_core.apis_relations.utils import ( get_content_types_with_allowed_relation_from, )