Skip to content

Commit

Permalink
T1835 Fix redirect loop for /child/<model('compassion.child'):child> (#…
Browse files Browse the repository at this point in the history
…50)

* Fix redirect loop for /child/<model('compassion.child'):child>

* Fix line length for pre-commit
  • Loading branch information
nlachat-compassion authored Oct 8, 2024
1 parent ee1f78c commit 687b993
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion website_sponsorship/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,16 @@ def load_child(self, **kwargs):

@http.route(
[
"/child/<model('compassion.child'):child>/",
# [T1835] : Note: the route MUST be specified *without* a trailing
# "/" otherwise when a child with a given id does not exist, the 404
# Not Found page is not displayed and instead we get an infinite
# redirect loop. The root cause is that specifying a path with a
# trailing "/" adds the "/" to the path, and then ir_http.py
# (https://github.com/odoo/odoo/blob/
# f2765d2cab5671a010404c36842bf1b4c4d6350b/addons/website/models
# /ir_http.py#L265) redirects to a version without the "/", creating
# the infinite loop.
"/child/<model('compassion.child'):child>",
],
type="http",
auth="public",
Expand Down

0 comments on commit 687b993

Please sign in to comment.