Skip to content

Commit

Permalink
chore(debug): only print json-api information in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
anehx committed Dec 2, 2024
1 parent b71d074 commit 797d6c8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions generic_permissions/visibilities.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from functools import reduce
from warnings import warn

from django.conf import settings
from rest_framework.relations import MANY_RELATION_KWARGS, ManyRelatedField
from rest_framework.serializers import PrimaryKeyRelatedField

Expand Down Expand Up @@ -166,9 +167,10 @@ class VisibilitySerializerMethodResourceRelatedField(
pass

except ModuleNotFoundError: # pragma: no cover
print(
"django-rest-framework-json-api is not installed. Skipping django-rest-framework-json-api related imports."
)
if settings.DEBUG:
print(
"django-rest-framework-json-api is not installed. Skipping django-rest-framework-json-api related imports."
)


class BaseVisibility: # pragma: no cover
Expand Down

0 comments on commit 797d6c8

Please sign in to comment.