haldis/app/utils.py

37 lines
707 B
Python
Raw Normal View History

2015-03-27 18:25:09 +01:00
from flask import render_template
from app import app
2015-03-28 20:38:15 +01:00
from login import login_manager
2015-03-27 18:25:09 +01:00
__author__ = 'feliciaan'
@app.template_filter('euro')
def euro(value):
result = '' + str(value/100)
return result
@app.errorhandler(404)
def handle404(e):
return render_template('errors/404.html'), 404
@app.errorhandler(401)
def handle401(e):
2015-03-28 20:38:15 +01:00
return render_template('errors/401.html'), 401
class AnonymouseUser:
def is_active(self):
return False
def is_authenticated(self):
return False
def is_anonymous(self):
return True
def is_admin(self):
return False
def get_id(self):
return None
login_manager.anonymous_user = AnonymouseUser