Esempio n. 1
0
 def get(self):
     """Returns all users."""
     was_successful, session_token = extract_token(request)
     response_object = {}
     if not was_successful:
         response_object["message"] = session_token
         return response_object, 400
     request_user = get_user_by_session_token(session_token)
     if request_user is None:
         response_object["message"] = "Unauthorized user."
         return response_object, 400
     users = get_all_users()
     # return marshal(users, user_fields), 200
     return list(map(lambda x: x.as_dict(), users)), 200
Esempio n. 2
0
 def get(self):
     """Returns all users."""
     return get_all_users(), 200
Esempio n. 3
0
 def get(self):
     """Returns all users."""
     users = get_all_users()
     return users