From 1dee6055cb5fe0d918ee9974b8be9a323c657a60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 8 Mar 2015 21:05:53 +0100 Subject: [PATCH] don't force a redirect on POST of forms without a category --- extra/modules/root.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extra/modules/root.py b/extra/modules/root.py index 3510631..858a737 100644 --- a/extra/modules/root.py +++ b/extra/modules/root.py @@ -851,9 +851,12 @@ class AlternateRootDirectory(OldRootDirectory): except KeyError: pass else: - if formdef.category_id is None: + # if there's no category, or the request is a POST, directly call + # into FormsRootDirectory. + if formdef.category_id is None or get_request().get_method() == 'POST': get_response().filter['bigdiv'] = 'rub_service' return FormsRootDirectory()._q_lookup(component) + # if there is category, let it fall back to raise TraversalError, # it will get caught in _q_traverse that will redirect it to an # URL embedding the category