mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 04:12:45 +00:00 
			
		
		
		
	move blueprints in dedicated folder
This commit is contained in:
		
							
								
								
									
										18
									
								
								app/blueprints/settings/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								app/blueprints/settings/__init__.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
from flask import Blueprint
 | 
			
		||||
from flask_login import login_required
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
bp = Blueprint('settings', __name__)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bp.before_request
 | 
			
		||||
@login_required
 | 
			
		||||
def before_request():
 | 
			
		||||
    '''
 | 
			
		||||
    Ensures that the routes in this package can only be visited by users that
 | 
			
		||||
    are logged in.
 | 
			
		||||
    '''
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
from . import routes
 | 
			
		||||
							
								
								
									
										10
									
								
								app/blueprints/settings/routes.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								app/blueprints/settings/routes.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
from flask import g, url_for
 | 
			
		||||
from flask_login import current_user
 | 
			
		||||
from app.blueprints.users.settings.routes import settings as settings_route
 | 
			
		||||
from . import bp
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bp.route('/settings', methods=['GET', 'POST'])
 | 
			
		||||
def settings():
 | 
			
		||||
    g._nopaque_redirect_location_on_post = url_for('.settings')
 | 
			
		||||
    return settings_route(current_user.id)
 | 
			
		||||
		Reference in New Issue
	
	Block a user