• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TurboGears / tg2 / 46165621281
100%

Build:
DEFAULT BRANCH: development
Ran 28 Nov 2026 04:32PM UTC
Jobs 15
Files 100
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Nov 2026 04:31PM UTC coverage: 99.939%. Remained the same
46165621281

push

github

web-flow
Don't crash on unexposed actions when enforcing allowed methods (#153)

Fixes #152

Since `allowed_methods` was added to `@expose`,
`DecoratedController._call` reads `action.decoration` before anything
else touches the action. An action set by a custom `_dispatch` that was
never exposed has no decoration yet. Kallithea's JSON-RPC controller is
one case: its `_dispatch` calls `state.set_action(self._rpc_call, [])`.
Every such request now fails with:

```
AttributeError: 'function' object has no attribute 'decoration'
  tg/controllers/decoratedcontroller.py, in _call
    self._enforce_allowed_methods(action.decoration, context.request)
```

In 2.5.0 the same request worked, because the first `hooks.notify(...,
controller=action)` created the decoration through
`Decoration.get_decoration`.

This change gets the decoration with
`Decoration.get_decoration(default_im_func(action))` before enforcing
allowed methods, as suggested in the issue. Unexposed actions behave as
they did in 2.5.0, and exposed actions with `allowed_methods` are still
restricted.

Tests:
- Added `TestCustomDispatchToUnexposedAction` in
`tests/test_expose_allowed_methods.py`, a controller whose `_dispatch`
routes to an unexposed method. It fails on master with the
`AttributeError` above and passes with the fix.
- Full suite: 960 passed, 3 skipped.
- `ruff check` and `ruff format --check` on `tg/` are clean, and `python
-m build` succeeds.

Signed-off-by: Tony Coder <407243179@qq.com>

3 of 3 new or added lines in 1 file covered. (100.0%)

4896 of 4899 relevant lines covered (99.94%)

14.98 hits per line

Jobs
ID Job ID Ran Files Coverage
1 46165621281.1 28 Nov 2026 04:32PM UTC 100
99.94
GitHub Action Run
2 46165621281.2 28 Nov 2026 04:32PM UTC 100
99.94
GitHub Action Run
3 46165621281.3 28 Nov 2026 04:32PM UTC 100
99.94
GitHub Action Run
4 46165621281.4 28 Nov 2026 04:32PM UTC 100
99.94
GitHub Action Run
5 46165621281.5 28 Nov 2026 04:32PM UTC 100
99.94
GitHub Action Run
6 46165621281.6 28 Nov 2026 04:32PM UTC 100
99.94
GitHub Action Run
7 46165621281.7 28 Nov 2026 04:32PM UTC 100
99.94
GitHub Action Run
8 46165621281.8 28 Nov 2026 04:32PM UTC 100
99.94
GitHub Action Run
9 46165621281.9 28 Nov 2026 04:32PM UTC 100
99.94
GitHub Action Run
10 46165621281.10 28 Nov 2026 04:32PM UTC 100
99.94
GitHub Action Run
11 46165621281.11 28 Nov 2026 04:32PM UTC 100
99.82
GitHub Action Run
12 46165621281.12 28 Nov 2026 04:33PM UTC 100
99.82
GitHub Action Run
13 46165621281.13 28 Nov 2026 04:33PM UTC 100
99.82
GitHub Action Run
14 46165621281.14 28 Nov 2026 04:33PM UTC 100
99.82
GitHub Action Run
15 46165621281.15 28 Nov 2026 04:33PM UTC 100
99.82
GitHub Action Run
Source Files on build 46165621281
  • Tree
  • List 100
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 68017597 on github
  • Prev Build on development (#38308634371)
  • Next Build on development (#46170527225)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc