diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2020-11-02 22:41:55 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2020-11-02 22:41:55 +0100 |
commit | abd6d3f844f9c1f1f523f32728ee09731bc01728 (patch) | |
tree | 361e8297a1c1c981d46a3344fd278da1090b2502 | |
parent | ensures that a feed always have a link: when adding a new feed or importing a... (diff) | |
download | newspipe-abd6d3f844f9c1f1f523f32728ee09731bc01728.tar.gz newspipe-abd6d3f844f9c1f1f523f32728ee09731bc01728.tar.bz2 newspipe-abd6d3f844f9c1f1f523f32728ee09731bc01728.zip |
added a command to delete a user with its id.
-rwxr-xr-x | newspipe/commands.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/newspipe/commands.py b/newspipe/commands.py index c58c66ae..40bd583e 100755 --- a/newspipe/commands.py +++ b/newspipe/commands.py @@ -51,6 +51,17 @@ def create_admin(nickname, password): print(e) +@application.cli.command("delete_user") +@click.option('--user-id', required=True, help='Id of the user to delete.') +def delete_user(user_id=None): + "Delete the user with the id specified in the command line." + try: + user = UserController().delete(user_id) + print("User {} deleted".format(user.nickname)) + except Exception as e: + print(e) + + @application.cli.command("fetch_asyncio") @click.option('--user-id', default=None, help='Id of the user') @click.option('--feed-id', default=None, help='If of the feed') |