def adminrequired(f):

    @wraps(f)
    def wrapper(*args, **kwargs):
        if ((not current_user) or (not current_user.approved)):
            return redirect(('/login?return_to=' + urllib.parse.quote_plus(request.url)))
        else:
            if (not current_user.admin):
                abort(401)
            return f(*args, **kwargs)
    return wrapper
def adminrequired(f):

    @wraps(f)
    def wrapper(*args, **kwargs):
        if ((not current_user) or (not current_user.approved)):
            return redirect(('/login?return_to=' + urllib.parse.quote_plus(request.url)))
        else:
            if (not current_user.admin):
                abort(401)
            return f(*args, **kwargs)
    return wrapper