Update API vies and serializers for the latest Django REST framework version. Replace DRF Swagger with DRF-YASG.

Signed-off-by: Michael Price <loneviking72@gmail.com>
This commit is contained in:
Michael Price
2018-03-04 04:29:04 -04:00
committed by Roberto Rosario
parent 77a3c103d1
commit 4378b28777
20 changed files with 298 additions and 194 deletions

View File

@@ -201,12 +201,15 @@ class APIUserGroupList(generics.ListCreateAPIView):
"""
Extra context provided to the serializer class.
"""
return {
'format': self.format_kwarg,
'request': self.request,
'user': self.get_user(),
'view': self
}
context = super(APIUserGroupList, self).get_serializer_context()
if self.kwargs:
context.update(
{
'user': self.get_user(),
}
)
return context
def get_queryset(self):
user = self.get_user()