From 88f48c8f0194e680baed2b9d343baff6cf57a4ad Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Tue, 3 Sep 2024 08:33:06 +0100 Subject: Another docstring only --- pyblackbird_cc/resources/views.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'pyblackbird_cc/resources') 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) -- cgit v1.2.3