context error

Patch and later will prioritize this again to have context work with the yaml
This commit is contained in:
GabeKoga
2024-05-09 20:26:07 -03:00
parent ca08865384
commit 63d7aae865

View File

@@ -9,4 +9,9 @@ class YamlParser:
modified_content = re.sub(
r"(?<!\})(?<!\%)(?<!\#)\}(?!})", "}}", modified_content
)
# Check for 'context:' not followed by '[' and raise an error
if re.search(r"context:(?!\s*\[)", modified_content):
raise ValueError(
"Context is currently only supported in code when creating a task. Please use the 'context' key in the task configuration."
)
return modified_content