From 685f425e293a13d5139fe283f25a0e573c64928f Mon Sep 17 00:00:00 2001 From: mipel Date: Wed, 4 Aug 2021 13:34:28 +0200 Subject: [PATCH] Document open fix * fixes a bug in opening a document --- intervention/forms.py | 2 +- konova/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/intervention/forms.py b/intervention/forms.py index 87375f7b..e4feef00 100644 --- a/intervention/forms.py +++ b/intervention/forms.py @@ -135,7 +135,7 @@ class NewInterventionForm(BaseForm): intervention.save() for doc in documents: doc_obj = Document() - doc_obj.document = doc + doc_obj.file = doc # ToDo Add functionality for other attributes doc_obj.save() intervention.documents.add(doc_obj) diff --git a/konova/views.py b/konova/views.py index a784ba18..1c6189a0 100644 --- a/konova/views.py +++ b/konova/views.py @@ -113,7 +113,7 @@ def get_document_view(request: HttpRequest, id: str): """ doc = get_object_or_404(Document, id=id) - return FileResponse(doc.document, as_attachment=True) + return FileResponse(doc.file, as_attachment=True) @login_required