mirror of
https://git.wownero.com/lza_menace/wowstash.git
synced 2024-08-15 00:33:15 +00:00
add command to manually reset wallet data for a user
This commit is contained in:
parent
85ce2c2fb5
commit
375bbe9b98
2 changed files with 11 additions and 2 deletions
4
bin/cmd
4
bin/cmd
|
@ -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…
Reference in a new issue