1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

remove the User.object_roles view

This commit is contained in:
Wayne Witzel III 2016-06-14 11:42:23 -04:00
parent a47f47b790
commit 203ebd20e8

View File

@ -1201,19 +1201,6 @@ class UserRolesList(SubListCreateAttachDetachAPIView):
# We hide roles that shouldn't be seen in our queryset
return True
class UserObjectRolesList(SubListAPIView):
model = Role
serializer_class = RoleSerializer
parent_model = User
new_in_300 = True
def get_queryset(self):
po = self.get_parent_object()
content_type = ContentType.objects.get_for_model(self.parent_model)
return Role.objects.filter(content_type=content_type, object_id=po.pk)
class UserProjectsList(SubListAPIView):
model = Project