AC-612 Return appropriate status code for server errors. Catch IntegrityError via the API and return a 400 response with error message instead of server error.

This commit is contained in:
Chris Church
2013-11-06 23:44:48 -05:00
parent 475c0d87c2
commit 2b01cc7059
4 changed files with 21 additions and 5 deletions

View File

@@ -163,6 +163,7 @@ REST_FRAMEWORK = {
'rest_framework.renderers.JSONRenderer',
'awx.api.renderers.BrowsableAPIRenderer',
),
'EXCEPTION_HANDLER': 'awx.api.views.api_exception_handler',
'VIEW_NAME_FUNCTION': 'awx.api.generics.get_view_name',
'VIEW_DESCRIPTION_FUNCTION': 'awx.api.generics.get_view_description',
}