App Factory pattern
This commit is contained in:
		@@ -375,7 +375,7 @@ def _view_entry(id:str=None):
 | 
			
		||||
@admin.route('/certificate/',methods=['POST'])
 | 
			
		||||
@login_required
 | 
			
		||||
def _generate_certificate():
 | 
			
		||||
    from main import db
 | 
			
		||||
    from ..extensions import db
 | 
			
		||||
    id = request.get_json()['id']
 | 
			
		||||
    entry = Entry.query.filter_by(id=id).first()
 | 
			
		||||
    if not entry: return jsonify({'error': 'Invalid entry ID.'}), 404
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user