fix bug in actions: action.row/col might be None and can't be passed directly to rset.get_entity tls-sprint
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Fri, 24 Apr 2009 09:04:45 +0200
branchtls-sprint
changeset 1465 42f13c790f11
parent 1459 f3d8a9228bd3
child 1466 07a2d0c387ca
fix bug in actions: action.row/col might be None and can't be passed directly to rset.get_entity
web/views/actions.py
--- a/web/views/actions.py	Thu Apr 23 18:10:17 2009 +0200
+++ b/web/views/actions.py	Fri Apr 24 09:04:45 2009 +0200
@@ -167,7 +167,7 @@
         return super(ManagePermissionsAction, cls).registered(vreg)
 
     def url(self):
-        return self.rset.get_entity(self.row, self.col).absolute_url(vid='security')
+        return self.rset.get_entity(self.row or 0, self.col or 0).absolute_url(vid='security')
 
 
 class DeleteAction(Action):
@@ -180,7 +180,7 @@
 
     def url(self):
         if len(self.rset) == 1:
-            entity = self.rset.get_entity(self.row, self.col)
+            entity = self.rset.get_entity(self.row or 0, self.col or 0)
             return self.build_url(entity.rest_path(), vid='deleteconf')
         return self.build_url(rql=self.rset.printable_rql(), vid='deleteconf')