summaryrefslogtreecommitdiff
path: root/patchwork/views
diff options
context:
space:
mode:
authorAndriy Gelman <andriy.gelman@gmail.com>2020-03-10 23:20:04 -0400
committerStephen Finucane <stephenfinucane@hotmail.com>2020-03-11 12:48:55 +0000
commit6cbfc2a43f19182942ad425877f0c5a4d3d7200f (patch)
treeb0ffe2fe5a4a016e9be559501784e4762c8a2e0f /patchwork/views
parentcdf43a770a61fa38dd5a80ef659fcf8e201dcd85 (diff)
downloadpatchwork-6cbfc2a43f19182942ad425877f0c5a4d3d7200f.tar
patchwork-6cbfc2a43f19182942ad425877f0c5a4d3d7200f.tar.gz
views: Return Http404 if patch not found
Otherwise exception DoesNotExist shows error 500 on Apache Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com> Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #343
Diffstat (limited to 'patchwork/views')
-rw-r--r--patchwork/views/patch.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/patchwork/views/patch.py b/patchwork/views/patch.py
index f34053c..b368cfa 100644
--- a/patchwork/views/patch.py
+++ b/patchwork/views/patch.py
@@ -41,7 +41,7 @@ def patch_detail(request, project_id, msgid):
# redirect to cover letters where necessary
try:
patch = Patch.objects.get(project_id=project.id, msgid=db_msgid)
- except Patch.DoesNotExist as exc:
+ except Patch.DoesNotExist:
submissions = Submission.objects.filter(project_id=project.id,
msgid=db_msgid)
if submissions:
@@ -49,7 +49,7 @@ def patch_detail(request, project_id, msgid):
reverse('cover-detail',
kwargs={'project_id': project.linkname,
'msgid': msgid}))
- raise exc
+ raise Http404('Patch does not exist')
editable = patch.is_editable(request.user)
context = {