From d29874a92dc8098cfc8e62567f0c31d1eb189bf7 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Wed, 14 Oct 2020 21:26:42 -0700 Subject: [PATCH] add create_accounts command for when refreshing prod db on dev --- suchwow/app.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/suchwow/app.py b/suchwow/app.py index d988bbc..7786852 100644 --- a/suchwow/app.py +++ b/suchwow/app.py @@ -53,6 +53,14 @@ def init(): # init db db.create_tables([Post, Profile, Comment, Notification]) +@app.cli.command("create_accounts") +def create_accounts(): + wallet = wownero.Wallet() + for post in Post.select(): + if post.account_index not in wallet.accounts(): + account = wallet.new_account() + print(f"Created account {account}") + @app.cli.command("payout_users") def payout_users(): wallet = wownero.Wallet()