Skip to content

Commit

Permalink
fix: do not import anything from contenttypes at module level
Browse files Browse the repository at this point in the history
  • Loading branch information
bellini666 committed Aug 24, 2023
1 parent aed240e commit 7f78798
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions strawberry_django/utils/query.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import functools
from typing import TYPE_CHECKING, List, Optional, Set, Type, TypeVar, cast

from django.contrib.contenttypes.models import ContentTypeManager
from django.core.exceptions import FieldDoesNotExist
from django.db.models import Exists, F, Model, Q, QuerySet
from django.db.models.functions import Cast
Expand Down Expand Up @@ -82,7 +81,7 @@ def filter_for_user_q(
model = model._meta.concrete_model

try:
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.models import ContentType, ContentTypeManager
except (ImportError, RuntimeError): # pragma: no cover
ctype = None
else:
Expand Down

0 comments on commit 7f78798

Please sign in to comment.