equal
deleted
inserted
replaced
9 from cubicweb.common.uilib import soup2xhtml |
9 from cubicweb.common.uilib import soup2xhtml |
10 from cubicweb.server.hooksmanager import Hook |
10 from cubicweb.server.hooksmanager import Hook |
11 from cubicweb.server.pool import PreCommitOperation |
11 from cubicweb.server.pool import PreCommitOperation |
12 |
12 |
13 |
13 |
14 class AddUpdateEUserHook(Hook): |
14 class AddUpdateCWUserHook(Hook): |
15 """ensure user logins are stripped""" |
15 """ensure user logins are stripped""" |
16 events = ('before_add_entity', 'before_update_entity',) |
16 events = ('before_add_entity', 'before_update_entity',) |
17 accepts = ('EUser',) |
17 accepts = ('CWUser',) |
18 |
18 |
19 def call(self, session, entity): |
19 def call(self, session, entity): |
20 if 'login' in entity and entity['login']: |
20 if 'login' in entity and entity['login']: |
21 entity['login'] = entity['login'].strip() |
21 entity['login'] = entity['login'].strip() |
22 |
22 |