Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
multilingual middleware used ADMIN_MEDIA_PREFIX setting, not present …
…in django1.4
  • Loading branch information
bercab committed Aug 17, 2012
1 parent bac31f8 commit a01fcad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cms/middleware/multilingual.py
Expand Up @@ -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]

Expand All @@ -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(.*?))("|\')(.*?)>' % (
Expand Down

0 comments on commit a01fcad

Please sign in to comment.