summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2009-11-18 09:48:19 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2009-11-18 09:48:19 (GMT)
commit70808926f5d17c2359608fba3caa0f4f72bd9440 (patch)
tree8469b5e340bb0178ae212d400465ab8f8bbeed2c
parentaeb6585052fb30c2a33625863df07cb6d2584526 (diff)
downloadpratic-70808926f5d17c2359608fba3caa0f4f72bd9440.zip
pratic-70808926f5d17c2359608fba3caa0f4f72bd9440.tar.gz
pratic-70808926f5d17c2359608fba3caa0f4f72bd9440.tar.bz2
Check collectivity exists when loading it from cookie
-rw-r--r--idp/extra/modules/root.ptl2
1 files changed, 2 insertions, 0 deletions
diff --git a/idp/extra/modules/root.ptl b/idp/extra/modules/root.ptl
index 58a8a31..fbb7fba 100644
--- a/idp/extra/modules/root.ptl
+++ b/idp/extra/modules/root.ptl
@@ -180,6 +180,8 @@ class AlternateRootDirectory(OldRootDirectory):
collectivity = get_request().cookies['collectivity']
except KeyError:
collectivity = None
+ if collectivity not in [x.dn for x in collectivities]:
+ collectivity = None
form.add(SingleSelectWidget, 'collectivity', title = _('Collectivity'), required = True,
value = collectivity, options = collectivities)
form.widgets.append(password_widget)