[entities] default implementation for after_deletion_path goes back to the parent if any stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 06 Oct 2009 17:13:08 +0200
branchstable
changeset 3566 521337e71fbb
parent 3565 4db55832e8a9
child 3567 c43ce7949acf
[entities] default implementation for after_deletion_path goes back to the parent if any
entities/__init__.py
--- a/entities/__init__.py	Tue Oct 06 17:12:26 2009 +0200
+++ b/entities/__init__.py	Tue Oct 06 17:13:08 2009 +0200
@@ -183,6 +183,8 @@
         """return (path, parameters) which should be used as redirect
         information when this entity is being deleted
         """
+        if self.parent():
+            return self.parent().rest_path(), {}
         return str(self.e_schema).lower(), {}
 
     def pre_web_edit(self):