fix: Update types to make code more reliable

This commit is contained in:
2025-08-25 12:28:26 +10:00
parent f090b7b71a
commit a619d78efd
3 changed files with 117 additions and 76 deletions

View File

@@ -152,7 +152,10 @@ def getPluginFunctions(plugin: str):
return plugin.functions
def runPluginFunction(plugin: str, function: str, params: dict, authentication: str):
def runPluginFunction(plugin: str, function: str, params: dict, authentication: (str|None)):
if not authentication:
return {"error": "Authentication required"}
plugin_module = import_module(plugin.replace("/","."))
if function not in plugin_module.functions:
return {"error": "Function not found"}