def get(self):
     """ Method to retrieve all exisiting users """
     usr = User(None, None, None, None)
     users = usr.get_all_users()
     if not users:
         return make_response(
             jsonify({
                 'message': 'No users subscribed as yet',
             }), 200)
     user_lst = []
     for u in users:
         user = {
             "user_id": u[0],
             "first_name": u[1],
             "last_name": u[2],
             "email": u[3],
             "password": u[4]
         }
         user_lst.append(user)
     return make_response(jsonify({
         'status': 'success',
         'users': user_lst
     }), 200)
Example #2
0
def get_all_users():
    """List all system users"""
    return check_return(User.get_all_users())