aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2020-11-02 22:41:55 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2020-11-02 22:41:55 +0100
commitabd6d3f844f9c1f1f523f32728ee09731bc01728 (patch)
tree361e8297a1c1c981d46a3344fd278da1090b2502
parentensures that a feed always have a link: when adding a new feed or importing a... (diff)
downloadnewspipe-abd6d3f844f9c1f1f523f32728ee09731bc01728.tar.gz
newspipe-abd6d3f844f9c1f1f523f32728ee09731bc01728.tar.bz2
newspipe-abd6d3f844f9c1f1f523f32728ee09731bc01728.zip
added a command to delete a user with its id.
-rwxr-xr-xnewspipe/commands.py11
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')
bgstack15