Skip to content

Commit a01fcad

Browse files
committed
multilingual middleware used ADMIN_MEDIA_PREFIX setting, not present in django1.4
1 parent bac31f8 commit a01fcad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cms/middleware/multilingual.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ def patch_response(content, pages_root, language):
4141
# If the regex matches, the extracted path we want is stored in the fourth group (\4).
4242
quoted_root = urllib.quote(pages_root)
4343
ignore_paths = ['%s%s/' % (quoted_root, lang[0]) for lang in settings.CMS_LANGUAGES]
44-
ignore_paths += [settings.MEDIA_URL, settings.ADMIN_MEDIA_PREFIX]
44+
ignore_paths += [settings.MEDIA_URL]
45+
if getattr(settings, 'ADMIN_MEDIA_PREFIX', False):
46+
ignore_paths += [settings.ADMIN_MEDIA_PREFIX]
4547
if getattr(settings,'STATIC_URL', False):
4648
ignore_paths += [settings.STATIC_URL]
4749

@@ -56,7 +58,9 @@ def patch_response(content, pages_root, language):
5658
# For understanding this regex, please read the documentation for HREF_URL_FIX_RE above.
5759

5860
ignore_paths = ['%s%s/' % (pages_root, lang[0]) for lang in settings.CMS_LANGUAGES]
59-
ignore_paths += [settings.MEDIA_URL, settings.ADMIN_MEDIA_PREFIX]
61+
ignore_paths += [settings.MEDIA_URL]
62+
if getattr(settings, 'ADMIN_MEDIA_PREFIX', False):
63+
ignore_paths += [settings.ADMIN_MEDIA_PREFIX]
6064
if getattr(settings,'STATIC_URL', False):
6165
ignore_paths += [settings.STATIC_URL]
6266
FORM_URL_FIX_RE = re.compile(ur'<form([^>]+)action=("|\')(?=%s)(?!(%s))(%s(.*?))("|\')(.*?)>' % (

0 commit comments

Comments
 (0)