backoffice: add redirects from /manage/ (#12446) #530
|
@ -192,6 +192,16 @@ def test_backoffice_home(pub):
|
|||
resp.follow()
|
||||
|
||||
|
||||
def test_backoffice_manage_redirect(pub):
|
||||
app = get_app(pub)
|
||||
assert app.get('/manage', status=302).location == 'http://example.net/backoffice'
|
||||
assert app.get('/manage/studio/', status=302).location == 'http://example.net/backoffice/studio/'
|
||||
assert (
|
||||
app.get('/manage/studio/?param=1', status=302).location
|
||||
== 'http://example.net/backoffice/studio/?param=1'
|
||||
)
|
||||
|
||||
|
||||
def test_backoffice_role_user(pub):
|
||||
create_user(pub)
|
||||
app = login(get_app(pub))
|
||||
|
|
|
@ -283,6 +283,9 @@ class RootDirectory(Directory):
|
|||
get_publisher().substitutions.feed(get_request().user)
|
||||
|
||||
def _q_traverse(self, path):
|
||||
if path and path[0] == 'manage':
|
||||
return redirect('/backoffice' + get_request().get_path_query().removeprefix('/manage'))
|
||||
|
||||
self.forced_language = False
|
||||
self.feed_substitution_parts()
|
||||
|
||||
|
|
Loading…
Reference in New Issue