vad / django-ajaxutils

Ajax requests for Ponies™

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't specify error codes

armisael opened this issue · comments

I'd like to be able to specify the status code of the response, something like:

try:
  something_nasty()
except:
  return {
    'some-info': 'here', 
    'some-other': here',
  }, 418 

Nice idea! BTW ATM you can return a JsonResponse:

return JsonResponse({
        'status': 'error',
        'error': response.content,
    },
    status=status_code
)