Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
bug 730707: Bugfix case-sensitivity in locale detection and migration
Browse files Browse the repository at this point in the history
  • Loading branch information
lmorchard committed Apr 18, 2012
1 parent 7f2f0d2 commit 24f464d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -817,7 +817,7 @@ def get_kuma_locale_and_slug_for_page(self, r):
if '/' in title:
# Treat the first part of the slug path as locale and snip it off.
mt_language, new_title = title.split('/', 1)
if mt_language in MT_TO_KUMA_LOCALE_MAP:
if mt_language.lower() in MT_TO_KUMA_LOCALE_MAP:
# If it's a known language, then rebuild the slug
slug = '%s%s' % (ns_name, new_title)
else:
Expand Down
4 changes: 2 additions & 2 deletions apps/wiki/models.py
Expand Up @@ -559,10 +559,10 @@ def locale_and_slug_from_path(path, request=None):
if '/' in path:
locale, slug = path.split('/', 1)

if locale in settings.MT_TO_KUMA_LOCALE_MAP:
if locale.lower() in settings.MT_TO_KUMA_LOCALE_MAP:
# If this looks like a MindTouch locale, remap it.
old_locale = locale
locale = settings.MT_TO_KUMA_LOCALE_MAP[locale]
locale = settings.MT_TO_KUMA_LOCALE_MAP[locale.lower()]
# But, we only need a redirect if the locale actually changed.
needs_redirect = (locale != old_locale)

Expand Down

0 comments on commit 24f464d

Please sign in to comment.