Document open fix
* fixes a bug in opening a document
This commit is contained in:
parent
6818ef290e
commit
6d75fdb7a7
@ -135,7 +135,7 @@ class NewInterventionForm(BaseForm):
|
|||||||
intervention.save()
|
intervention.save()
|
||||||
for doc in documents:
|
for doc in documents:
|
||||||
doc_obj = Document()
|
doc_obj = Document()
|
||||||
doc_obj.document = doc
|
doc_obj.file = doc
|
||||||
# ToDo Add functionality for other attributes
|
# ToDo Add functionality for other attributes
|
||||||
doc_obj.save()
|
doc_obj.save()
|
||||||
intervention.documents.add(doc_obj)
|
intervention.documents.add(doc_obj)
|
||||||
|
@ -113,7 +113,7 @@ def get_document_view(request: HttpRequest, id: str):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
doc = get_object_or_404(Document, id=id)
|
doc = get_object_or_404(Document, id=id)
|
||||||
return FileResponse(doc.document, as_attachment=True)
|
return FileResponse(doc.file, as_attachment=True)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
Loading…
Reference in New Issue
Block a user