mirror of
https://github.com/Mailu/Mailu.git
synced 2025-01-16 02:46:44 +02:00
add more CLI operations: deletions of users and aliases
This commit is contained in:
parent
28f490ddee
commit
95fd89808c
@ -134,6 +134,22 @@ def config_update(delete_objects=False):
|
|||||||
db.session.delete(alias)
|
db.session.delete(alias)
|
||||||
db.session.commit()
|
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
|
@manager.command
|
||||||
def alias(localpart, domain_name, destination):
|
def alias(localpart, domain_name, destination):
|
||||||
""" Create an alias
|
""" Create an alias
|
||||||
|
Loading…
Reference in New Issue
Block a user