nopaque/app/users/cli.py

15 lines
356 B
Python
Raw Normal View History

2023-12-21 13:27:50 +00:00
from app.models import User
import os
import shutil
from app import db
from . import bp
@bp.cli.command('reset')
def reset():
''' Reset terms of use accept '''
for user in [x for x in User.query.all() if x.terms_of_use_accepted]:
print(f'Resetting user {user.username}')
user.terms_of_use_accepted = False
db.session.commit()