Ticket #2358 (closed defect: fixed)
override_template does not work if @without_trailing_slash placed before @expose)
| Reported by: | sbeilin | Owned by: | rick446 |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.1b2 |
| Component: | TurboGears | Version: | 2.0.1 |
| Severity: | minor | Keywords: | |
| Cc: |
Description (last modified by jorge.vargas) (diff)
override_template does not work (just does not change the template) if @without_trailing_slash is placed before @expose. If @expose() is placed first and @without_trailing_slash after it, it works as expected.
Stepped in with TG2 2.0.1 and 2.0.3.
Maybe also happens with other decorators -- not tested.
Change History
comment:2 Changed 2 years ago by chrisz
There was a similar problem with @paginate and @validate (#2303) that has been solved in TG 2.1 by implementing @paginate using the Decoration class in tg.decorators. This allows you to control exactly where the decator is hooked in. Maybe we need to do the same with @without_trailing_slash, @with_trailing_slash and @postpone_commits.
comment:3 Changed 2 years ago by jorge.vargas
- Owner set to percious
- Summary changed from override_template does not work if @without_trailing_slash placed after @expose to override_template does not work if @without_trailing_slash placed before @expose)
- Description modified (diff)
- Milestone set to 2.1
+1 on chrisz's point. All our decorators should be order agnostic
comment:5 Changed 2 years ago by percious
- Owner percious deleted
I'm un-assigning myself this ticket cause I think it's dumb. I mean seriously. this decorator constitutes about 4 lines of code and you want to hang more crap of decorated controller. If someone wants to do this I am all for it, just don't want to spend any time on it myself, sorry 'bout that.
Oops! must read as:
override_template does not work if @without_trailing_slash placed *before* @expose)