hooks/integrity.py
changeset 2900 9d65e0350aa1
parent 2896 1e7848c69be4
child 2901 8f4d495c94c2
--- a/hooks/integrity.py	Tue Aug 18 09:12:52 2009 +0200
+++ b/hooks/integrity.py	Tue Aug 18 09:13:12 2009 +0200
@@ -252,6 +252,7 @@
     __select__ = IntegrityHook.__select__ & entity_implements('CWUser')
     events = ('before_add_entity', 'before_update_entity',)
 
-    def call(self, session, entity):
-        if 'login' in entity.edited_attributes and entity['login']:
-            entity['login'] = entity['login'].strip()
+    def __call__(self):
+        user = self.entity
+        if 'login' in user.edited_attributes and user.login:
+            entity.login = entity.login.strip()