Skip to content
Snippets Groups Projects

Resolve "Provide infrastructure for live documents"

Merged Jonathan Weth requested to merge 3-provide-infrastructure-for-live-documents into master
All threads resolved!
1 file
+ 4
1
Compare changes
  • Side-by-side
  • Inline
@@ -3,7 +3,7 @@ from typing import Any, Dict, Type
from django.contrib.contenttypes.models import ContentType
from django.db.models import QuerySet
from django.forms import BaseModelForm, modelform_factory
from django.http import FileResponse, HttpRequest
from django.http import FileResponse, HttpRequest, Http404
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from django.utils.decorators import method_decorator
@@ -229,4 +229,7 @@ class LiveDocumentShowView(PermissionRequiredMixin, SingleObjectMixin, View):
def get(self, request: HttpRequest, *args: Any, **kwargs: Any) -> FileResponse:
live_document = self.get_object()
file = live_document.get_current_file()
if not file:
raise Http404
return FileResponse(live_document.get_current_file(), content_type="application/pdf")
Loading