Skip to content

Commit 8858c01

Browse files
authored
Fix get_path for django-ninja 1.5.0 (#187)
1 parent ccba3b7 commit 8858c01

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

apitally/django.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,11 @@ def get_path(self, request: HttpRequest) -> Optional[str]:
294294
if self.ninja_available:
295295
from ninja.operation import PathView
296296

297-
if hasattr(match.func, "__self__") and isinstance(match.func.__self__, PathView):
297+
if (hasattr(match.func, "__self__") and isinstance(match.func.__self__, PathView)) or (
298+
hasattr(match, "_func_path")
299+
and isinstance(match._func_path, str)
300+
and match._func_path.startswith("ninja.")
301+
):
298302
return _transform_path(match.route)
299303
if self.include_django_views:
300304
return _transform_path(match.route)

uv.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)