Beispiel #1
0
 def getFriends(self, request, accessToken):
     try:
         #Get user by access token
         user = UserAccessToken.objects.get(access_token=accessToken).user
         userFriend = UserFriend.getUserFriendByUser(user)
         friendList = []
         #Manipulate userFriend data
         for friend in userFriend:
             friendList.append(self.userToDictionary(friend.recipient))
         #Response
         return self.response({
             'status': 200,
             'data': {
                 'friendList': friendList
             }
         })
     except:
         return self.response({
             'status': 500,
             'message': 'Bad request'
         })
Beispiel #2
0
 def getUserFriend(self, request):
     if (self.isLoggedIn(request)):
         return UserFriend.getUserFriendByUser(
             self.getUserLogin(request).user)