Erase user email when party is erased

issue7169
review40151002
This commit is contained in:
Cédric Krier
2018-03-24 00:11:28 +01:00
parent 60bc21794f
commit 93665656fc
3 changed files with 19 additions and 2 deletions
+1
View File
@@ -1,3 +1,4 @@
* Erase user email when party is erased
* Require email only for active user
* Add maximum authentication attempt
+1
View File
@@ -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,
+17 -2
View File
@@ -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