From 97808ba1c369033aa1055695a6f730c11e5f1f3d Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 22 Aug 2024 15:23:32 +0200 Subject: [PATCH] refac --- backend/apps/webui/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/apps/webui/main.py b/backend/apps/webui/main.py index a540dc440..065cdeba0 100644 --- a/backend/apps/webui/main.py +++ b/backend/apps/webui/main.py @@ -251,10 +251,12 @@ def get_function_params(function_module, form_data, user, extra_params=None): extra_params = {} pipe_id = get_pipe_id(form_data) + # Get the signature of the function sig = inspect.signature(function_module.pipe) - addition_params = {k: v for k, v in extra_params.items() if k in sig.parameters} - params = {"body": form_data} | addition_params + params = {"body": form_data} | { + k: v for k, v in extra_params.items() if k in sig.parameters + } if "__user__" in params and hasattr(function_module, "UserValves"): user_valves = Functions.get_user_valves_by_id_and_user_id(pipe_id, user.id)