def METHOD_NAME(view, request, *args, **kwargs):
    if not settings.ENABLE_LIMIT_IPADDRESS:
        error_msg = 'Feature disabled.'
        return api_error(status.HTTP_403_FORBIDDEN, error_msg)
    if request.method in ["DELETE", "POST"]:
        ipaddress = request.data.get('ipaddress', '')
        if not ipaddress:
            error_msg = 'IP address can not be empty.'
            return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
        try:
            validate_ipv4_address(ipaddress.replace('*', '1'))
        except ValidationError:
            error_msg = "IP address invalid."
            return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
    return func(view, request, *args, **kwargs)