Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ django-storages = "^1.13.2"
djangorestframework = "^3.14.0"
drf-jwt = "^1.19.2"
drf-nested-routers = "^0.95.0"
drf-spectacular = "^0.28.0"
drf-spectacular = "^0.29.0"
feedparser = "^6.0.10"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The custom CustomDjangoFilterExtension uses fragile positional argument access (args[4]) in resolve_filter_field, which will likely break due to refactoring in drf-spectacular 0.29.0.
Severity: HIGH

Suggested Fix

Refactor the resolve_filter_field method in main/schema.py to use keyword arguments instead of positional arguments. Inspect the method signature in drf-spectacular 0.29.0 to identify the correct parameter names and update the implementation to access them safely, removing the dependency on argument order.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: pyproject.toml#L52

Potential issue: The `CustomDjangoFilterExtension` in `main/schema.py` overrides the
`resolve_filter_field` method and accesses the fifth positional argument via `args[4]`.
This implementation assumes a fixed method signature. The `drf-spectacular` 0.29.0
release notes state that the django-filter extension was significantly refactored. If
the signature of `resolve_filter_field` has changed in the new version, accessing
`args[4]` could lead to an `IndexError` or incorrect behavior during OpenAPI schema
generation. This would cause a runtime failure when the API schema is accessed.

Did we get this right? 👍 / 👎 to inform future reviews.

google-api-python-client = "^2.89.0"
granian = "^2.5.4"
Expand Down
Loading