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
# 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:
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 = {
--- /dev/null
+---
+fixes:
+ - |
+ Previously, attempting to retrieve a patch that did not exist would result
+ in a ``HTTP 500`` (Internal Server Error) being raised. This has been
+ corrected and a ``HTTP 404`` (Not Found) is now raised instead.