#27402: When using i18n_patterns and prefix_default_language=False, 404 page
redirects incorrectly
-------------------------------------+-------------------------------------
Reporter: Hovi | Owner: nobody
Type: Uncategorized | Status: new
Component: | Version: 1.10
Internationalization |
Severity: Normal | Resolution:
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 Hovi):
It's definitely not same thing as #27063. I took a deeper look and it is a
little more complicated.
When I just added test, it was passing anyway and it turned out problem is
little more specific to my case (it is still bug though).
I have something like this in my url as last record without i18npatterns:
r'^(?P<group1>.+)/(?P<group2>.+)/$
So what exactly happens here:
1, language_path is constructed as /en/non-existent-page instead of /non-
existent-page
2, language_path passes is_valid_path(language_path,... because that url
matches my regex.
3, that leads to redirect
Code after that constructs url for redirect (variable language_url) also
doesn't take into account possibility default language without prefix, so
that part may also need reviewing but I am not even sure if that can ever
happen.
Attaching simple test.
--
Ticket URL: <https://code.djangoproject.com/ticket/27402#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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/062.24f588ab96809c7d734c679642e445c1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.