Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

multilingual middleware used ADMIN_MEDIA_PREFIX setting, not present …

…in django1.4
  • Loading branch information...
commit a01fcad504b1cac01f4aa64861135c936d6b2af1 1 parent bac31f8
@bercab authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 cms/middleware/multilingual.py
View
8 cms/middleware/multilingual.py
@@ -41,7 +41,9 @@ def patch_response(content, pages_root, language):
# If the regex matches, the extracted path we want is stored in the fourth group (\4).
quoted_root = urllib.quote(pages_root)
ignore_paths = ['%s%s/' % (quoted_root, lang[0]) for lang in settings.CMS_LANGUAGES]
- ignore_paths += [settings.MEDIA_URL, settings.ADMIN_MEDIA_PREFIX]
+ ignore_paths += [settings.MEDIA_URL]
+ if getattr(settings, 'ADMIN_MEDIA_PREFIX', False):
+ ignore_paths += [settings.ADMIN_MEDIA_PREFIX]
if getattr(settings,'STATIC_URL', False):
ignore_paths += [settings.STATIC_URL]
@@ -56,7 +58,9 @@ def patch_response(content, pages_root, language):
# For understanding this regex, please read the documentation for HREF_URL_FIX_RE above.
ignore_paths = ['%s%s/' % (pages_root, lang[0]) for lang in settings.CMS_LANGUAGES]
- ignore_paths += [settings.MEDIA_URL, settings.ADMIN_MEDIA_PREFIX]
+ ignore_paths += [settings.MEDIA_URL]
+ if getattr(settings, 'ADMIN_MEDIA_PREFIX', False):
+ ignore_paths += [settings.ADMIN_MEDIA_PREFIX]
if getattr(settings,'STATIC_URL', False):
ignore_paths += [settings.STATIC_URL]
FORM_URL_FIX_RE = re.compile(ur'<form([^>]+)action=("|\')(?=%s)(?!(%s))(%s(.*?))("|\')(.*?)>' % (
Please sign in to comment.
Something went wrong with that request. Please try again.