зеркало из https://github.com/mozilla/FlightDeck.git
raise a 404 error if attachment cant be found
This commit is contained in:
Родитель
31af8b21ba
Коммит
b56bc5d793
|
@ -768,7 +768,8 @@ def package_remove_attachment(r, id_number, type_id, revision_number):
|
|||
return HttpResponseForbidden('You are not the author of this Package')
|
||||
|
||||
uid = r.POST.get('uid', '').strip()
|
||||
attachment = Attachment.objects.get(pk=uid, revisions=revision)
|
||||
attachment = get_object_with_related_or_404(Attachment,
|
||||
pk=uid, revisions=revision)
|
||||
|
||||
if not attachment:
|
||||
log_msg = ('Attempt to remove a non existing attachment. attachment: '
|
||||
|
|
Загрузка…
Ссылка в новой задаче