From abd6d3f844f9c1f1f523f32728ee09731bc01728 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 2 Nov 2020 22:41:55 +0100 Subject: added a command to delete a user with its id. --- newspipe/commands.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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') -- cgit