aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-09-03 08:33:06 +0100
committerMatthew Lemon <y@yulqen.org>2024-09-03 08:33:06 +0100
commit88f48c8f0194e680baed2b9d343baff6cf57a4ad (patch)
tree1b8e501ddb046b6eb5dd5b462615a256d868c149
parenta7cf8d5d8eca2cf66fddf05ecf00f81e63899906 (diff)
Another docstring only
-rw-r--r--pyblackbird_cc/resources/views.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/pyblackbird_cc/resources/views.py b/pyblackbird_cc/resources/views.py
index 02985e4..ab12b64 100644
--- a/pyblackbird_cc/resources/views.py
+++ b/pyblackbird_cc/resources/views.py
@@ -374,6 +374,20 @@ def update_resource_metadata(request, pk): # Change resource_id to pk
@login_required()
def add_resource_pdfs(request, pk):
+ """
+ Adds PDF files to a resource in the system.
+
+ This view handles the process of adding PDF files to an existing resource.
+ It allows the user to upload one or more PDF files, which are then processed and associated with the resource.
+ The view creates PDFResource and PDFPageSnapshot objects to represent the uploaded PDFs and their page snapshots, and uploads the files to S3 storage.
+
+ Args:
+ request (django.http.request.HttpRequest): The HTTP request object.
+ pk (int): The primary key of the resource to which the PDFs will be added.
+
+ Returns:
+ django.http.response.HttpResponse: A redirect to the resource detail page upon successful PDF upload.
+ """
resource = get_object_or_404(Resource, pk=pk)
if request.method == "POST":
form = ResourceUpdatePDFsForm(resource.get_absolute_url(), request.POST, request.FILES)