Skip to content

Commit 67f17fb

Browse files
committed
Update Documentation
1 parent f20ff17 commit 67f17fb

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

app/api/files/views.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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),

app/next-client-app/components/files/DeleteFileDialog.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
Dialog,
55
DialogClose,
66
DialogContent,
7+
DialogDescription,
78
DialogFooter,
89
DialogHeader,
910
DialogTitle,
@@ -59,11 +60,11 @@ const DeleteFileDialog = ({
5960
<DialogContent>
6061
<DialogHeader className="text-start">
6162
<DialogTitle>Delete File</DialogTitle>
63+
<DialogDescription>
64+
Are you sure you want to delete "{fileName}"? This action cannot be
65+
undone and will permanently remove the file from storage.
66+
</DialogDescription>
6267
</DialogHeader>
63-
<p className="text-sm text-muted-foreground">
64-
Are you sure you want to delete "{fileName}"? This action cannot be
65-
undone and will permanently remove the file from storage.
66-
</p>
6768
<DialogFooter className="flex-col space-y-2 sm:space-y-0 sm:space-x-2">
6869
<Button variant="destructive" onClick={handleDelete}>
6970
Delete

0 commit comments

Comments
 (0)