Erase user email when party is erased
issue7169 review40151002
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Erase user email when party is erased
|
||||
* Require email only for active user
|
||||
* Add maximum authentication attempt
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ def register():
|
||||
module='web_user', type_='model')
|
||||
Pool.register(
|
||||
party.PartyReplace,
|
||||
party.PartyErase,
|
||||
module='web_user', type_='wizard')
|
||||
Pool.register(
|
||||
EmailValidation,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.pool import PoolMeta
|
||||
from trytond.pool import PoolMeta, Pool
|
||||
|
||||
__all__ = ['PartyReplace']
|
||||
__all__ = ['PartyReplace', 'PartyErase']
|
||||
|
||||
|
||||
class PartyReplace:
|
||||
@@ -14,3 +14,18 @@ class PartyReplace:
|
||||
return super(PartyReplace, cls).fields_to_replace() + [
|
||||
('web.user', 'party'),
|
||||
]
|
||||
|
||||
|
||||
class PartyErase:
|
||||
__metaclass__ = PoolMeta
|
||||
__name__ = 'party.erase'
|
||||
|
||||
def to_erase(self, party_id):
|
||||
pool = Pool()
|
||||
User = pool.get('web.user')
|
||||
to_erase = super(PartyErase, self).to_erase(party_id)
|
||||
to_erase.append(
|
||||
(User, [('party', '=', party_id)], True,
|
||||
['email'],
|
||||
[None]))
|
||||
return to_erase
|
||||
|
||||
Reference in New Issue
Block a user