views: when a document is not found report if the document doest not exist of if the user does not have access to it
fixes #4225
This commit is contained in:
parent
2483aaf31e
commit
0c5d03a57c
|
@ -246,7 +246,16 @@ def message(request, mailbox_id, outbox=False):
|
|||
try:
|
||||
document = get_document(request, mailbox_id, outbox)
|
||||
except Document.DoesNotExist:
|
||||
raise Http404
|
||||
if Document.objects.filter(pk=mailbox_id):
|
||||
messages.warning(request,
|
||||
_('You cannot see this document as you are not the recipient'))
|
||||
else:
|
||||
messages.warning(request,
|
||||
_('Document not found'))
|
||||
if outbox:
|
||||
return redirect('outbox')
|
||||
else:
|
||||
return redirect('inbox')
|
||||
if outbox:
|
||||
back_pair = (reverse('outbox'), gettext_noop('back to outbox'))
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue