prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  PROTECTION_RULES: Custom Validator does not show error message on object deletion
  ### Deployment Type
  
  Self-hosted
  
  ### NetBox Version
  
  v4.0-beta1 (commit c7f6c206cf5068f890b89da9ca04d4d3583f5107)
  
  ### Python Version
  
  3.11
  
  ### Steps to Reproduce
  
  1. Create a custom validator with the following code:
  ```python
  from extras.validators import CustomValidator
  from utilities.exceptions import AbortRequest
  
  
  class IPAddressDeleteValidator(CustomValidator):
  
      def validate(self, instance, request):
          raise AbortRequest("Do not delete IP addresses!")
  ```
  and store as `/opt/netbox/validators/test.py`
  
  2. Add the custom validator as a protect rule for `IPAddress` objects:
  ```python
  PROTECTION_RULES = {
      "ipam.ipaddress": [
          "validators.test.IPAddressDeleteValidator",
      ]
  }
  ```
  3. Navigate to IPAM/IP Addresses
  4. Create an arbitrary IP address
  5. Click on "Delete" in the new address's detail view and confirm deletion
  
  ### Expected Behavior
  
  The IP address is not deleted, an error message is shown saying "Do not delete IP addresses!"
  
  ### Observed Behavior
  
  The IP address is not deleted, but there is no error message. 
  
  The error message is, however, displayed when one tries to delete an IP address using the bulk edit view:
  
  ![Untitled](https://github.com/netbox-community/netbox/assets/6815386/799c7aad-8d48-4b53-b776-dfd9582400b5)
  
  </issue>
  <code>
  [start of netbox/utilities/htmx.py]
  1 __all__ = (
  2     'htmx_partial',
  3 )
  4 
  5 PAGE_CONTAINER_ID = 'page-content'
  6 
  7 
  8 def htmx_partial(request):
  9     """
  10     Determines whether to render partial (versus complete) HTML content
  11     in response to an HTMX request, based on the target element.
  12     """
  13     return request.htmx and request.htmx.target and request.htmx.target != PAGE_CONTAINER_ID
  14
  [end of netbox/utilities/htmx.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/netbox/utilities/htmx.py b/netbox/utilities/htmx.py
  --- a/netbox/utilities/htmx.py
  +++ b/netbox/utilities/htmx.py
  @@ -2,12 +2,10 @@
       'htmx_partial',
   )
   
  -PAGE_CONTAINER_ID = 'page-content'
  -
   
   def htmx_partial(request):
       """
       Determines whether to render partial (versus complete) HTML content
       in response to an HTMX request, based on the target element.
       """
  -    return request.htmx and request.htmx.target and request.htmx.target != PAGE_CONTAINER_ID
  +    return request.htmx and not request.htmx.boosted
  
verification_info: {"golden_diff": "diff --git a/netbox/utilities/htmx.py b/netbox/utilities/htmx.py\n--- a/netbox/utilities/htmx.py\n+++ b/netbox/utilities/htmx.py\n@@ -2,12 +2,10 @@\n     'htmx_partial',\n )\n \n-PAGE_CONTAINER_ID = 'page-content'\n-\n \n def htmx_partial(request):\n     \"\"\"\n     Determines whether to render partial (versus complete) HTML content\n     in response to an HTMX request, based on the target element.\n     \"\"\"\n-    return request.htmx and request.htmx.target and request.htmx.target != PAGE_CONTAINER_ID\n+    return request.htmx and not request.htmx.boosted\n", "issue": "PROTECTION_RULES: Custom Validator does not show error message on object deletion\n### Deployment Type\r\n\r\nSelf-hosted\r\n\r\n### NetBox Version\r\n\r\nv4.0-beta1 (commit c7f6c206cf5068f890b89da9ca04d4d3583f5107)\r\n\r\n### Python Version\r\n\r\n3.11\r\n\r\n### Steps to Reproduce\r\n\r\n1. Create a custom validator with the following code:\r\n```python\r\nfrom extras.validators import CustomValidator\r\nfrom utilities.exceptions import AbortRequest\r\n\r\n\r\nclass IPAddressDeleteValidator(CustomValidator):\r\n\r\n    def validate(self, instance, request):\r\n        raise AbortRequest(\"Do not delete IP addresses!\")\r\n```\r\nand store as `/opt/netbox/validators/test.py`\r\n\r\n2. Add the custom validator as a protect rule for `IPAddress` objects:\r\n```python\r\nPROTECTION_RULES = {\r\n    \"ipam.ipaddress\": [\r\n        \"validators.test.IPAddressDeleteValidator\",\r\n    ]\r\n}\r\n```\r\n3. Navigate to IPAM/IP Addresses\r\n4. Create an arbitrary IP address\r\n5. Click on \"Delete\" in the new address's detail view and confirm deletion\r\n\r\n### Expected Behavior\r\n\r\nThe IP address is not deleted, an error message is shown saying \"Do not delete IP addresses!\"\r\n\r\n### Observed Behavior\r\n\r\nThe IP address is not deleted, but there is no error message. \r\n\r\nThe error message is, however, displayed when one tries to delete an IP address using the bulk edit view:\r\n\r\n![Untitled](https://github.com/netbox-community/netbox/assets/6815386/799c7aad-8d48-4b53-b776-dfd9582400b5)\n", "before_files": [{"content": "__all__ = (\n    'htmx_partial',\n)\n\nPAGE_CONTAINER_ID = 'page-content'\n\n\ndef htmx_partial(request):\n    \"\"\"\n    Determines whether to render partial (versus complete) HTML content\n    in response to an HTMX request, based on the target element.\n    \"\"\"\n    return request.htmx and request.htmx.target and request.htmx.target != PAGE_CONTAINER_ID\n", "path": "netbox/utilities/htmx.py"}]}