mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-29 19:35:20 +02:00
fix automation run inputs, hitl routing, and detail UI polish
This commit is contained in:
parent
ed8d56aa16
commit
91962ba879
8 changed files with 258 additions and 86 deletions
|
|
@ -67,8 +67,15 @@ async def dispatch_run(
|
|||
def _validate_inputs(
|
||||
definition: AutomationDefinition, inputs: dict[str, Any]
|
||||
) -> dict[str, Any]:
|
||||
"""Validate merged inputs against the optional declared schema.
|
||||
|
||||
No declared schema → pass through (runtime inputs like ``fired_at`` /
|
||||
``last_fired_at`` and trigger ``static_inputs`` must still reach the
|
||||
template context). Returning ``{}`` here strips them and makes Jinja
|
||||
blow up on any ``{{ inputs.* }}`` reference.
|
||||
"""
|
||||
if definition.inputs is None or not definition.inputs.schema_:
|
||||
return {}
|
||||
return inputs
|
||||
try:
|
||||
jsonschema.validate(instance=inputs, schema=definition.inputs.schema_)
|
||||
except jsonschema.ValidationError as exc:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue