return document or 404 no 500

This commit is contained in:
j 2015-02-20 15:13:23 +00:00
parent 88b73553db
commit 6693bfcd0f

View file

@ -23,7 +23,7 @@ import models
def get_document_or_404_json(id):
try:
return models.Document.get(id)
except models.Document.DoesNotExist:
except:
response = {'status': {'code': 404,
'text': 'Document not found'}}
raise HttpErrorJson(response)