Skip to content

Commit

Permalink
remove duplicate BaseUsersList
Browse files Browse the repository at this point in the history
  • Loading branch information
wwitzel3 committed Nov 7, 2018
1 parent 198a0db commit 1b465c4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
2 changes: 1 addition & 1 deletion awx/api/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Django
from django.conf import settings
from django.core.exceptions import FieldError, ObjectDoesNotExist
from django.db.models import Q, Count
from django.db.models import Q
from django.db import IntegrityError, transaction, connection
from django.shortcuts import get_object_or_404
from django.utils.encoding import smart_text
Expand Down
19 changes: 0 additions & 19 deletions awx/api/views/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,25 +134,6 @@ class OrganizationInventoriesList(SubListAPIView):
relationship = 'inventories'


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
# auditor role member list.. unfortunately this means we can't
# set it on creation, and thus needs to be set here.
user = User.objects.get(id=ret.data['id'])
user.is_system_auditor = request.data['is_system_auditor']
ret.data['is_system_auditor'] = request.data['is_system_auditor']
except AttributeError as exc:
print(exc)
pass
return ret


class OrganizationUsersList(BaseUsersList):

model = User
Expand Down

0 comments on commit 1b465c4

Please sign in to comment.