@@ -35,7 +35,7 @@ class FileDownloadView(
3535 - Download a specific file by its primary key.
3636 - Request the generation of a file for download by sending a message to a queue.
3737 - Delete a file manually from storage and database.
38- - Automatically filter files older than OLD_FILE_THRESHOLD from the list .
38+ - Return all non-deleted files (frontend handles auto-hiding based on age) .
3939 Attributes:
4040 serializer_class (Serializer): The serializer class used for file downloads.
4141 filter_backends (list): The list of filter backends for filtering querysets.
@@ -44,8 +44,7 @@ class FileDownloadView(
4444 ordering (str): The default ordering for querysets.
4545 Methods:
4646 get_queryset():
47- Retrieves the queryset of FileDownload objects filtered by the scan report ID
48- and age (files older than OLD_FILE_THRESHOLD are excluded).
47+ Retrieves all non-deleted FileDownload objects for a scan report.
4948 get(request, *args, **kwargs):
5049 Handles GET requests. If a primary key is provided, it downloads the file.
5150 Otherwise, it returns a paginated list of files.
@@ -150,9 +149,7 @@ def post(self, request, *args, **kwargs):
150149 file_type_description = (
151150 "JSON V1"
152151 if file_type == "application/json_v1"
153- else "JSON V2"
154- if file_type == "application/json_v2"
155- else "CSV"
152+ else "JSON V2" if file_type == "application/json_v2" else "CSV"
156153 )
157154 Job .objects .create (
158155 scan_report = ScanReport .objects .get (id = scan_report_id ),
0 commit comments