avoid applying system auditor prop if action was association

This commit is contained in:
AlanCoding
2016-12-05 11:40:26 -05:00
parent f0e7385f54
commit 057efd3d5a
2 changed files with 16 additions and 1 deletions

View File

@@ -768,7 +768,7 @@ class BaseUsersList(SubListCreateAttachDetachAPIView):
def post(self, request, *args, **kwargs):
ret = super(BaseUsersList, self).post( request, *args, **kwargs)
try:
if request.data.get('is_system_auditor', False):
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
# auditor role member list.. unfortunately this means we can't
# set it on creation, and thus needs to be set here.