0001-misc-raise-a-404-if-i18n-page-is-accessed-with-i18n-.patch
tests/admin_pages/test_i18n.py | ||
---|---|---|
48 | 48 |
pub.write_cfg() |
49 | 49 |
resp = app.get('/backoffice/studio/') |
50 | 50 |
assert '../i18n/' not in resp.text |
51 |
app.get('/backoffice/i18n/', status=404) |
|
51 | 52 | |
52 | 53 | |
53 | 54 |
def test_i18n_page(pub): |
wcs/backoffice/i18n.py | ||
---|---|---|
18 | 18 |
import xml.etree.ElementTree as ET |
19 | 19 |
import zipfile |
20 | 20 | |
21 |
from quixote import get_request, get_response, redirect |
|
21 |
from quixote import get_publisher, get_request, get_response, redirect
|
|
22 | 22 |
from quixote.directory import Directory |
23 | 23 |
from quixote.html import TemplateIO, htmltext |
24 | 24 |
from quixote.http_request import parse_query |
... | ... | |
60 | 60 |
def _q_index(self): |
61 | 61 |
from wcs.i18n import TranslatableMessage |
62 | 62 | |
63 |
if not get_publisher().has_i18n_enabled(): |
|
64 |
raise errors.TraversalError() |
|
65 | ||
63 | 66 |
if TranslatableMessage.count() == 0: |
64 | 67 |
return self.scan() |
65 | 68 |
html_top('i18n', title=_('Multilinguism')) |
66 |
- |