From aef4f1cc9acfdab2f74164ed271d86974a548de8 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sun, 29 Jul 2012 18:09:41 -0500 Subject: [PATCH] wiki force_prefix again --- VERSION | 2 +- gluon/tools.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index f4b46525..da8ebdd6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-07-29 17:37:29) dev +Version 2.00.0 (2012-07-29 18:09:36) dev diff --git a/gluon/tools.py b/gluon/tools.py index 8fa6d4ee..95855401 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -4396,7 +4396,7 @@ class Wiki(object): self.auth = auth self.automenu = automenu perms = self.manage_permissions = manage_permissions - self.force_prefix = force_prefix + self.force_prefix = force_prefix or '' db = auth.db db.define_table( 'wiki_page', @@ -4502,7 +4502,8 @@ class Wiki(object): title_guess = ' '.join(c.capitalize() for c in slug.split('-')) if not page: if not slug.startswith(self.force_prefix): - raise HTTP(401) + session.flash='slug bust have "%s" prefix' % self.force_prefix + redirect(URL(args=('_edit',force_prefix+slug))) db.wiki_page.can_read = [Wiki.everybody] db.wiki_page.can_edit = [auth.user_group_role()] db.wiki_page.title.default = title_guess