# HG changeset patch # User Sylvain Thénault # Date 1250579592 -7200 # Node ID 9d65e0350aa1351fbe03ff54c37b07b3c570a597 # Parent 3f7ce804d1e529f163c306bd8efa1ee5904bbe0b api update diff -r 3f7ce804d1e5 -r 9d65e0350aa1 hooks/integrity.py --- 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() diff -r 3f7ce804d1e5 -r 9d65e0350aa1 hooks/notification.py --- a/hooks/notification.py Tue Aug 18 09:12:52 2009 +0200 +++ b/hooks/notification.py Tue Aug 18 09:13:12 2009 +0200 @@ -28,8 +28,8 @@ category = 'notification' def select_view(self, vid, rset, row=0, col=0): - return self._cw.vreg['views'].select_object(vid, self._cw, - rset=rset, row=0, col=0) + return self._cw.vreg['views'].select_or_none(vid, self._cw, + rset=rset, row=0, col=0) class StatusChangeHook(NotificationHook):