Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1310 from tremmert/develop

Fixes wrong language prefix handling for form actions and admin preview (issue #1304)
  • Loading branch information...
commit beb718a382666e5be2b180fee03f02f53e9a751c 2 parents cfdea7e + 215f02a
@digi604 digi604 authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  cms/middleware/multilingual.py
  2. +1 −1  cms/templatetags/cms_admin.py
View
2  cms/middleware/multilingual.py
@@ -70,7 +70,7 @@ def patch_response(content, pages_root, language):
))
content = HREF_URL_FIX_RE.sub(ur'<a\1href=\2/%s%s\5\6\7>' % (language, pages_root), content)
- content = FORM_URL_FIX_RE.sub(ur'<form\1action=\2%s%s/\5\6\7>' % (pages_root, language), content).encode("utf8")
+ content = FORM_URL_FIX_RE.sub(ur'<form\1action=\2/%s%s\5\6\7>' % (language, pages_root), content).encode("utf8")
return content
View
2  cms/templatetags/cms_admin.py
@@ -167,7 +167,7 @@ def preview_link(page, language):
try:
# attempt to retrieve the localized path/slug and return
root = reverse('pages-root')
- return root + language + "/" + page.get_absolute_url(language, fallback=False)[len(root):]
+ return "/" + language + root + page.get_absolute_url(language, fallback=False)[len(root):]
except:
# no localized path/slug. therefore nothing to preview. stay on the same page.
# perhaps the user should be somehow notified for this.
Please sign in to comment.
Something went wrong with that request. Please try again.