示例#1
0
    def get(self, request, **kwargs):
        pk = str(kwargs["pk"])
        good_pk = str(kwargs["good_pk"])
        doc_pk = str(kwargs["doc_pk"])

        document, _ = get_application_document(request, pk, good_pk, doc_pk)
        return download_document_from_s3(document["s3_key"], document["name"])
示例#2
0
    def get(self, request, **kwargs):
        self.object_type = kwargs["object_type"]
        self.case_pk = str(kwargs["case_pk"])
        self.query_pk = str(kwargs["query_pk"])
        self.doc_pk = str(kwargs["doc_pk"])

        document = get_ecju_query_document(request, self.case_pk,
                                           self.query_pk, self.doc_pk)
        return download_document_from_s3(document["s3_key"], document["name"])
示例#3
0
    def get(self, request, **kwargs):
        draft_id = str(kwargs["pk"])
        action = document_switch(request.path)["download"]

        if len(signature(action).parameters) == 2:
            document, _ = action(request, draft_id)
        else:
            document, _ = action(request, draft_id, kwargs["obj_pk"])

        document = document["document"]
        if document["safe"]:
            return download_document_from_s3(document["s3_key"], document["name"])
        else:
            return error_page(request, strings.applications.AttachDocumentPage.DOWNLOAD_GENERIC_ERROR)
示例#4
0
    def get(self, request, **kwargs):
        good_id = str(kwargs["pk"])
        file_pk = str(kwargs["file_pk"])

        document = get_good_document(request, good_id, file_pk)
        return download_document_from_s3(document["s3_key"], document["name"])