Merge pull request #1272 from AlanCoding/user_create_err

handle 400 error creating sys auditor
This commit is contained in:
Alan Rominger 2018-04-09 14:37:25 -04:00 committed by GitHub
commit 51d43e59e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -995,6 +995,8 @@ class OrganizationInventoriesList(SubListAPIView):
class BaseUsersList(SubListCreateAttachDetachAPIView):
def post(self, request, *args, **kwargs):
ret = super(BaseUsersList, self).post( request, *args, **kwargs)
if ret.status_code != 201:
return ret
try:
if ret.data is not None and request.data.get('is_system_auditor', False):
# This is a faux-field that just maps to checking the system