Fix template_filter to support usage without parentheses; fix typing error

This commit is contained in:
Akshay 2025-05-16 15:13:22 +05:30
parent c5d00407b3
commit cec6f73b88
2 changed files with 4 additions and 6 deletions

View file

@ -2,9 +2,7 @@ version: 2
build: build:
os: ubuntu-24.04 os: ubuntu-24.04
tools: tools:
python: '3.13' python: '3.11' # safer stable version
commands: commands:
- asdf plugin add uv - pip install -r requirements.txt # if you have a requirements file for docs
- asdf install uv latest - sphinx-build -b dirhtml docs $READTHEDOCS_OUTPUT/html
- asdf global uv latest
- uv run --group docs sphinx-build -W -b dirhtml docs $READTHEDOCS_OUTPUT/html

View file

@ -680,7 +680,7 @@ class App(Scaffold):
""" """
if callable(name): if callable(name):
func = name func = t.cast(t.Callable[..., t.Any], name)
name = func.__name__ name = func.__name__
self.add_template_filter(func, name=name) self.add_template_filter(func, name=name)
return func # ✅ return original function (not a wrapper) return func # ✅ return original function (not a wrapper)