mirror of
				https://github.com/StefBuwalda/cal_counter.git
				synced 2025-10-30 03:10:00 +00:00 
			
		
		
		
	Deleted the /food_items and /barcode_test routes from admin, along with their associated templates and the delete_food functionality. This streamlines the admin blueprint by removing unused or deprecated features.
		
			
				
	
	
		
			16 lines
		
	
	
		
			284 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			284 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from flask import Blueprint, abort
 | |
| from flask_login import current_user
 | |
| 
 | |
| admin_bp = Blueprint(
 | |
|     "admin",
 | |
|     __name__,
 | |
|     url_prefix="/admin",
 | |
|     template_folder="templates",
 | |
| )
 | |
| 
 | |
| 
 | |
| @admin_bp.before_request
 | |
| def admin_required():
 | |
|     if not current_user.is_admin:
 | |
|         abort(403)
 |