add more CLI operations: deletions of users and aliases

master
Dmytro Makovey 7 years ago
parent d099e24f18
commit 433da57015

@ -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

Loading…
Cancel
Save