1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-14 10:53:30 +02:00

add more CLI operations: deletions of users and aliases

This commit is contained in:
Dmytro Makovey 2017-08-25 14:38:16 -07:00
parent d099e24f18
commit 433da57015

View File

@ -134,6 +134,22 @@ def config_update(delete_objects=False):
db.session.delete(alias)
db.session.commit()
@manager.command
def user_delete(email):
"""delete user"""
user = models.User.query.get(email)
if user:
db.session.delete(user)
db.session.commit()
@manager.command
def alias_delete(email):
"""delete alias"""
alias = models.Alias.query.get(email)
if alias:
db.session.delete(alias)
db.session.commit()
@manager.command
def alias(localpart, domain_name, destination):
""" Create an alias