#35170: LocaleMiddleware unexpectedly causes messages to be consumed under
certain
circumstances
-------------------------------------+-------------------------------------
Reporter: Sylvain Fankhauser | Owner: nobody
Type: Uncategorized | Status: closed
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sylvain Fankhauser):
Hello Natalia,
Thank you for taking the time to review the issue.
The reproduction code is indeed not using reverse on purpose, to mimic the
behaviour of `redirect_to_login` (which I’m actually using in my code,
instead of the `redirect(reverse("foobar"))` I put in the reproduction
code). `redirect_to_login` redirects to `settings.LOGIN_URL`, which
doesn’t have any language prefix and causes the initial 404. Perhaps the
proper fix in my case is to use a named URL for `settings.LOGIN_URL`
instead of the default, so that the language prefix is included in the URL
and no 404 is rendered.
I’m fine with keeping this as `invalid` as I don’t really see what else
could be done (except maybe change the default `settings.LOGIN_URL` to use
a named URL?).
--
Ticket URL: <https://code.djangoproject.com/ticket/35170#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018d9e400a47-4a1dad9e-7030-4b16-9579-0e44ba3db0d5-000000%40eu-central-1.amazonses.com.