fix(tasks): add queryset stub to satisfy drf-spectacular schema generation

TasksViewSet.get_queryset() accesses request.user, which drf-spectacular
cannot provide during static schema generation.  Adding a class-level
queryset = PaperlessTask.objects.none() gives spectacular a model to
introspect without invoking get_queryset(), eliminating both warnings
and the test_valid_schema failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
stumpylog
2026-04-15 13:59:02 -07:00
parent 8bba782ad9
commit cf341c19fe

View File

@@ -3786,6 +3786,8 @@ class TasksViewSet(ReadOnlyModelViewSet[PaperlessTask]):
"wait_time_seconds",
]
ordering = ["-date_created"]
# Needed for drf-spectacular schema generation (get_queryset touches request.user)
queryset = PaperlessTask.objects.none()
# v9 backwards compat: maps old "type" query param values to new TriggerSource
_V9_TYPE_TO_TRIGGER_SOURCE = {