Exemplo n.º 1
0
 def get_all_users():
     try:
         users = User.get_all_users()
         result_list = []
         for user in users:
             result_list.append(user.to_dict())
         result = {
             "message": "Success!",
             "users": result_list,
         }
         return jsonify(result), 200
     except Exception as err:
         return jsonify(message="Server error!", error=err.__str__()), 500