Skip to content

Commit

Permalink
refactor(history): move import statement into if block
Browse files Browse the repository at this point in the history
Only import the `get_generic_triple_table` method if the
`apis_core.apis_relations` app is in the list of INSTALLED_APPS.
  • Loading branch information
b1rger committed Nov 20, 2024
1 parent b754e68 commit cb37c8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apis_core/history/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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,
)
Expand Down

0 comments on commit cb37c8a

Please sign in to comment.