(f)
return inner
Only run functions with the
Only run functions with the
Only run functions with the
def is_staff(f):
    """
    Only run functions with the
    """
    def inner(request, **kwargs):
        user = request.user
        if user.is_authenticated and (user.is_staff or user.is_superuser):
            return f(request, **kwargs)
        messages.warning(request, "You need to be a staff member to perform this action.")
        return redirect('/')

    return inner
def is_staff ( f ) : def inner ( request , * * kwargs ) : user = request . user if user . is_authenticated and ( user . is_staff or user . is_superuser ) : return f ( request , * * kwargs ) messages . warning ( request , "You need to be a staff member to perform this action." ) return redirect ( '/' ) return inner