Skip to content

prefect.server.utilities.user_templates

Utilities to support safely rendering user-supplied templates

TemplateSecurityError

Bases: Exception

Raised when extended validation of a template fails.

Source code in src/prefect/server/utilities/user_templates.py
40
41
42
43
44
45
46
class TemplateSecurityError(Exception):
    """Raised when extended validation of a template fails."""

    def __init__(self, message: Optional[str] = None, line_number: int = 0) -> None:
        self.lineno = line_number
        self.message = message
        super().__init__(message)

register_user_template_filters(filters)

Register additional filters that will be available to user templates

Source code in src/prefect/server/utilities/user_templates.py
49
50
51
def register_user_template_filters(filters: Dict[str, Any]):
    """Register additional filters that will be available to user templates"""
    _template_environment.filters.update(filters)