@auth.before_app_request
def before_request():
    if current_user.is_authenticated:
        current_user.update_last_seen()
        if ((not current_user.confirmed) and (request.endpoint[:5] != 'auth.') and (request.endpoint != 'static')):
            return redirect(url_for('auth.unconfirmed'))
@auth.before_app_request
def before_request():
    if current_user.is_authenticated:
        current_user.update_last_seen()
        if ((not current_user.confirmed) and (request.endpoint[:5] != 'auth.') and (request.endpoint != 'static')):
            return redirect(url_for('auth.unconfirmed'))