mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-03 20:02:47 +00:00 
			
		
		
		
	Add user reste cli command
This commit is contained in:
		@@ -15,4 +15,4 @@ def before_request():
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
from . import events, json_routes, routes, settings
 | 
			
		||||
from . import cli, events, json_routes, routes, settings
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								app/users/cli.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								app/users/cli.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
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()
 | 
			
		||||
		Reference in New Issue
	
	Block a user