forked from 0x2620/pandora
return document or 404 no 500
This commit is contained in:
parent
88b73553db
commit
6693bfcd0f
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ import models
|
||||||
def get_document_or_404_json(id):
|
def get_document_or_404_json(id):
|
||||||
try:
|
try:
|
||||||
return models.Document.get(id)
|
return models.Document.get(id)
|
||||||
except models.Document.DoesNotExist:
|
except:
|
||||||
response = {'status': {'code': 404,
|
response = {'status': {'code': 404,
|
||||||
'text': 'Document not found'}}
|
'text': 'Document not found'}}
|
||||||
raise HttpErrorJson(response)
|
raise HttpErrorJson(response)
|
||||||
|
|
Loading…
Reference in a new issue