# -*- coding: utf-8 -*-

from functools import wraps
from flask import abort


def admin_required(f):
    @wraps(f)
    def decorated_function(*args, **kwargs):
        from flask_login import current_user
        if not current_user.is_authenticated and not current_user.is_admin:
            abort(403)
        return f(*args, **kwargs)
    return decorated_function

# -*- coding: utf-8 -*-

from functools import wraps
from flask import abort


def admin_required(f):
    @wraps(f)
    def decorated_function(*args, **kwargs):
        from flask_login import current_user
        if not current_user.is_authenticated or not current_user.is_admin:
            abort(403)
        return f(*args, **kwargs)
    return decorated_function

Abort when user is not authenticated or not an admin
Abort when user is not authenticated or not an admin
