Make it clear that we don't delete users

main
Florent Daigniere 2 years ago
parent b49d9ce243
commit 83ef6d773d

@ -400,18 +400,6 @@ def config_export(full=False, secrets=False, color=False, dns=False, output=None
finally:
os.umask(old_umask)
@mailu.command()
@click.argument('email')
@with_appcontext
def user_delete(email):
"""delete user"""
user = models.User.query.get(email)
if user:
db.session.delete(user)
db.session.commit()
@mailu.command()
@click.argument('email')
@with_appcontext

@ -31,7 +31,6 @@
<tr{% if not user.enabled %} class="warning"{% endif %}>
<td>
<a href="{{ url_for('.user_edit', user_email=user.email) }}" title="{% trans %}Edit{% endtrans %}"><i class="fas fa-pencil-alt"></i></a>&nbsp;
<a href="{{ url_for('.user_delete', user_email=user.email) }}" title="{% trans %}Delete{% endtrans %}"><i class="fa fa-trash"></i></a>
</td>
<td>
<a href="{{ url_for('.user_settings', user_email=user.email) }}" title="{% trans %}Settings{% endtrans %}"><i class="fa fa-wrench"></i></a>&nbsp;

@ -80,19 +80,6 @@ def user_edit(user_email):
domain=user.domain, max_quota_bytes=max_quota_bytes)
@ui.route('/user/delete/<path:user_email>', methods=['GET', 'POST'])
@access.domain_admin(models.User, 'user_email')
@access.confirmation_required("delete {user_email}")
def user_delete(user_email):
user = models.User.query.get(user_email) or flask.abort(404)
domain = user.domain
models.db.session.delete(user)
models.db.session.commit()
flask.flash('User %s deleted' % user)
return flask.redirect(
flask.url_for('.user_list', domain_name=domain.name))
@ui.route('/user/settings', methods=['GET', 'POST'], defaults={'user_email': None})
@ui.route('/user/usersettings/<path:user_email>', methods=['GET', 'POST'])
@access.owner(models.User, 'user_email')

@ -9,7 +9,6 @@ Managing users and aliases can be done from CLI using commands:
* password
* user
* user-import
* user-delete
* config-update
* config-export
* config-import
@ -63,13 +62,6 @@ primary difference with simple `user` command is that password is being imported
docker-compose run --rm admin flask mailu user-import myuser example.net '$6$51ebe0cb9f1dab48effa2a0ad8660cb489b445936b9ffd812a0b8f46bca66dd549fea530ce' 'SHA512-CRYPT'
user-delete
-----------
.. code-block:: bash
docker-compose exec admin flask mailu user-delete foo@example.net
config-update
-------------

@ -313,8 +313,6 @@ This page is also accessible for domain managers. On the users page new users ca
* Edit. For all available options see :ref:`the Add user page <webadministration_add_user>`.
* Delete. Deletes the user. The Admin GUI will ask for confirmation if the user must be really deleted.
* Setting. Access the settings page of the user. See :ref:`the settings page <webadministration_settings>` for more information.
* Auto-reply. Access the auto-reply page of the user. See the :ref:`auto-reply page <webadministration_auto-reply>` for more information.

Loading…
Cancel
Save