From 552f40a466a14b20c19de0fcb5772e406ce900bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 13 Nov 2008 16:11:17 +0100 Subject: [PATCH] Add check_recursion on location for issue546 --- location.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/location.py b/location.py index bae415ccd5..446df6e0be 100644 --- a/location.py +++ b/location.py @@ -64,6 +64,12 @@ class Location(OSV): def __init__(self): super(Location, self).__init__() self._order.insert(0, ('name', 'ASC')) + self._constraints += [ + ('check_recursion', 'recursive_locations'), + ] + self._error_messages.update({ + 'recursive_locations': 'You can not create recursive locations!', + }) def default_active(self, cursor, user, context=None): return True