Add check_recursion on webdav directories

This commit is contained in:
Cédric Krier
2008-02-15 15:01:56 +01:00
parent e0d87b2c12
commit 751b259fa9
+9
View File
@@ -25,6 +25,15 @@ class Directory(OSV):
('name_parent_uniq', 'UNIQUE (name, parent)',
'The directory name must be unique inside a directory!'),
]
def check_recursion(self, cursor, user, ids, parent=None):
return super(Directory, self).check_recursion(cursor, user, ids,
parent='parent')
_constraints = [
(check_recursion,
'Error! You can not create recursive directories.', ['parent']),
]
ext2mime = {
'.png': 'image/png',
}