def users_search(): searched_email = request.args.get("email") if searched_email.strip() == "" : return users_list() # this might be potentially dangerous users = db_find_users( {"email" : { "$regex" : searched_email} }); return jsonify( {'users' : users} ), 200
def users_list(): users = db_find_users({}); return jsonify( {'users' : users } ), 200