backoffice: add a notice on deleted user pages (#42393)
This commit is contained in:
parent
0791d9af7a
commit
1473d8edb0
|
@ -4177,6 +4177,23 @@ def test_users_delete(pub):
|
|||
assert PasswordAccount.count() == account_count - 1
|
||||
|
||||
|
||||
def test_users_view_deleted(pub):
|
||||
pub.user_class.wipe()
|
||||
PasswordAccount.wipe()
|
||||
create_superuser(pub)
|
||||
user = pub.user_class(name='foo bar')
|
||||
user.store()
|
||||
account = PasswordAccount(id='test')
|
||||
account.user_id = user.id
|
||||
account.store()
|
||||
|
||||
user.set_deleted()
|
||||
|
||||
app = login(get_app(pub))
|
||||
resp = app.get('/backoffice/users/%s/' % user.id)
|
||||
assert 'Marked as deleted on' in resp
|
||||
|
||||
|
||||
def test_users_pagination(pub):
|
||||
pub.user_class.wipe()
|
||||
PasswordAccount.wipe()
|
||||
|
|
|
@ -127,6 +127,12 @@ class UserPage(Directory):
|
|||
r += htmltext('</div>')
|
||||
users_cfg = get_cfg('users', {})
|
||||
|
||||
if self.user.deleted_timestamp:
|
||||
r += htmltext('<div class="warningnotice">')
|
||||
r += _('Marked as deleted on %(date)s.') % {
|
||||
'date': misc.localstrftime(self.user.deleted_timestamp)}
|
||||
r += htmltext('</div>')
|
||||
|
||||
r += htmltext('<div class="splitcontent-left">')
|
||||
|
||||
r += htmltext('<div class="bo-block">')
|
||||
|
|
Loading…
Reference in New Issue