def plot_favourite(fav_id): """View and edit saved plots.""" return render_template( 'users/plot_favourite.html', plot_data = get_favourite_plot_data(current_user, fav_id), raw = request.path.endswith('/raw'), user_token = current_user.api_token, )
def get_favourite_plot(user, *args, **kwargs): data = request.get_json() favourite_id = data.get("favourite_id") plot_results = get_favourite_plot_data(user, favourite_id) plot_results['success'] = True return jsonify(plot_results)