[sync schema hooks] pylint fixes have broken hasattr test stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 28 Sep 2011 10:36:41 +0200
branchstable
changeset 7880 f475a34d0ddc
parent 7879 9aae456abab5
child 7883 cd98785b4a84
[sync schema hooks] pylint fixes have broken hasattr test
hooks/syncschema.py
--- a/hooks/syncschema.py	Wed Sep 28 09:27:42 2011 +0200
+++ b/hooks/syncschema.py	Wed Sep 28 10:36:41 2011 +0200
@@ -804,7 +804,7 @@
             self.warning('no schema for %s', self.eid)
             return
         perms = list(erschema.action_permissions(self.action))
-        if hasattr(self, 'group_eid'):
+        if self.group_eid is not None:
             perm = self.session.entity_from_eid(self.group_eid).name
         else:
             perm = erschema.rql_expression(self.expr)
@@ -838,7 +838,7 @@
                self.action in ('delete', 'add'): # XXX 3.6.1 migration
             return
         perms = list(erschema.action_permissions(self.action))
-        if hasattr(self, 'group_eid'):
+        if self.group_eid is not None:
             perm = self.session.entity_from_eid(self.group_eid).name
         else:
             perm = erschema.rql_expression(self.expr)