add command to manually reset wallet data for a user

seed-restores
lza_menace 4 years ago
parent 85ce2c2fb5
commit 375bbe9b98

@ -3,5 +3,5 @@
source .venv/bin/activate
export FLASK_APP=wowstash/app.py
export FLASK_SECRETS=config.py
export FLASK_DEBUG=1
flask $1
export FLASK_DEBUG=0
flask $@

@ -1,3 +1,4 @@
import click
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_wtf.csrf import CSRFProtect
@ -68,6 +69,14 @@ def create_app():
from wowstash.library.docker import docker
docker.cleanup()
@app.cli.command('reset_wallet')
@click.argument('user_id')
def reset_wallet(user_id):
from wowstash.models import User
user = User.query.get(user_id)
user.clear_wallet_data()
print(f'Wallet data cleared for user {user.id}')
# Routes/blueprints
from wowstash.blueprints.auth import auth_bp
from wowstash.blueprints.wallet import wallet_bp

Loading…
Cancel
Save