Skip to content

Commit b4f7e43

Browse files
authored
Fix submission PDF download when project do not exist (#4569)
Fixes #4566
1 parent 6634fc2 commit b4f7e43

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

hypha/apply/funds/views/submission_detail.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from hypha.apply.activity.messaging import MESSAGES, messenger
2020
from hypha.apply.activity.views import ActivityContextMixin
2121
from hypha.apply.users.decorators import (
22-
staff_or_finance_required,
2322
staff_required,
2423
)
2524
from hypha.apply.utils.models import PDFPageSettings
@@ -272,18 +271,10 @@ def should_redirect(cls, request, submission):
272271
)
273272

274273

275-
@method_decorator(staff_or_finance_required, name="dispatch")
274+
@method_decorator(staff_required, "dispatch")
276275
class SubmissionDetailPDFView(SingleObjectMixin, View):
277276
model = ApplicationSubmission
278277

279-
def get_object(self, queryset=None):
280-
obj = super().get_object(queryset)
281-
282-
if not hasattr(obj, "project"):
283-
raise Http404
284-
285-
return obj
286-
287278
def get(self, request, *args, **kwargs):
288279
self.object = self.get_object()
289280
pdf_page_settings = PDFPageSettings.load(request_or_site=request)

0 commit comments

Comments
 (0)