Finished admin console
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from app.models import User
|
||||
from app.modules import bootstrap, csrf, db, login_manager, mail
|
||||
from config import Config
|
||||
|
||||
@@ -21,8 +22,8 @@ def create_app():
|
||||
|
||||
login_manager.login_view = 'admin._login'
|
||||
@login_manager.user_loader
|
||||
def _load_user(user_id):
|
||||
pass
|
||||
def _load_user(id):
|
||||
return User.query.filter_by(id=id).first()
|
||||
|
||||
@app.errorhandler(404)
|
||||
def _404_handler(error):
|
||||
@@ -32,7 +33,7 @@ def create_app():
|
||||
return jsonify({'error':'Could not validate a secure connection.'}), 403
|
||||
@app.context_processor
|
||||
def _now():
|
||||
return {'now': datetime.utcnow()}
|
||||
return {'now': datetime.now()}
|
||||
|
||||
from app.admin.views import admin
|
||||
from app.api.views import api
|
||||
|
Reference in New Issue
Block a user