From c968ef583cb02559b6782612c1d238ed117d55ec Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Tue, 19 Dec 2023 12:41:48 +1100 Subject: [PATCH] Use url_for to generate url for http functions on overview page --- services.py | 7 +------ templates/dashboard/http_functions.html | 5 +++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/services.py b/services.py index d8fb311..58ea373 100644 --- a/services.py +++ b/services.py @@ -1,13 +1,8 @@ def create_http_function_view_model(http_function): - # Base URL for the function invocation - base_url = "https://function.peterstockings.com/f/" - - name = http_function['name'] function_view_model = { "id": http_function['id'], - "name": name, + "name": http_function['name'], "script_content": http_function['script_content'], - "url": f"{base_url}{name}", "invoked_count": http_function['invoked_count'], "environment_info": http_function['environment_info'] } diff --git a/templates/dashboard/http_functions.html b/templates/dashboard/http_functions.html index 980ca2c..2b70f58 100644 --- a/templates/dashboard/http_functions.html +++ b/templates/dashboard/http_functions.html @@ -30,9 +30,10 @@ - {{ function.url }} + {{ + url_for('execute_http_function', function=function.name) }}