Exemple #1
0
 def put(self, request, pk, format=None):
     user = self.get_object(pk)
     serializer = PersonExpandedSerializer(user, data=request.data, partial=True)
     if serializer.is_valid():
         serializer.save()
         return Response(serializer.data)
     return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
Exemple #2
0
 def put(self, request, fb_id, format=None):
     account = self.get_account(fb_id)
     pk = account.user.id
     user = self.get_user(pk)
     serializer = PersonExpandedSerializer(user, data=request.data, partial=True)
     if serializer.is_valid():
         serializer.save()
         return Response(serializer.data)
     return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
Exemple #3
0
 def get(self, request, fb_id, format=None):
     account = self.get_account(fb_id)
     pk = account.user.id
     user = self.get_user(pk)
     serializer = PersonExpandedSerializer(user)
     return Response(serializer.data)
Exemple #4
0
 def get(self, request, pk, format=None):
     user = self.get_object(pk)
     serializer = PersonExpandedSerializer(user)
     return Response(serializer.data)