prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Fix for checkbox accessibility no longer working
  ### Current Behavior
  
  Checkboxes in django admin superuser no longer generated with an associated label.
  
  ### Expected Behavior
  
  Expect to see accessible checkboxes in django admin, no missing columns in either superuser or staff views.
  
  ### Steps to Reproduce
  
  1. Log in as superuser
  2. Go to list view on a model
  3. Run ANDI  or inspect checkboxes
  
  
  ### Environment
  
  _No response_
  
  ### Additional Context
  
  Traced this to the fix for missing columns in staff view. The check {% if results.0.form %} did not work and failed silently. Have a fix for this.
  
  Will prioritize implementation and deployment to staging since we have some accessibility testing in progress.
  
  ### Issue Links
  
  _No response_
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/registrar/templatetags/custom_filters.py`
  Content:
  ```
  1 from django import template
  2 import re
  3 
  4 register = template.Library()
  5 
  6 
  7 @register.filter(name="extract_value")
  8 def extract_value(html_input):
  9     match = re.search(r'value="([^"]*)"', html_input)
  10     if match:
  11         return match.group(1)
  12     return ""
  13 
  14 
  15 @register.filter
  16 def extract_a_text(value):
  17     # Use regex to extract the text within the <a> tag
  18     pattern = r"<a\b[^>]*>(.*?)</a>"
  19     match = re.search(pattern, value)
  20     if match:
  21         extracted_text = match.group(1)
  22     else:
  23         extracted_text = ""
  24 
  25     return extracted_text
  26 
  27 
  28 @register.filter
  29 def find_index(haystack, needle):
  30     try:
  31         return haystack.index(needle)
  32     except ValueError:
  33         return -1
  34 
  35 
  36 @register.filter
  37 def slice_after(value, substring):
  38     index = value.find(substring)
  39     if index != -1:
  40         result = value[index + len(substring) :]
  41         return result
  42     return value
  43
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/src/registrar/templatetags/custom_filters.py b/src/registrar/templatetags/custom_filters.py
  --- a/src/registrar/templatetags/custom_filters.py
  +++ b/src/registrar/templatetags/custom_filters.py
  @@ -40,3 +40,11 @@
           result = value[index + len(substring) :]
           return result
       return value
  +
  +
  +@register.filter
  +def contains_checkbox(html_list):
  +    for html_string in html_list:
  +        if re.search(r'<input[^>]*type="checkbox"', html_string):
  +            return True
  +    return False
  
verification_info: {"golden_diff": "diff --git a/src/registrar/templatetags/custom_filters.py b/src/registrar/templatetags/custom_filters.py\n--- a/src/registrar/templatetags/custom_filters.py\n+++ b/src/registrar/templatetags/custom_filters.py\n@@ -40,3 +40,11 @@\n         result = value[index + len(substring) :]\n         return result\n     return value\n+\n+\n+@register.filter\n+def contains_checkbox(html_list):\n+    for html_string in html_list:\n+        if re.search(r'<input[^>]*type=\"checkbox\"', html_string):\n+            return True\n+    return False\n", "issue": "Fix for checkbox accessibility no longer working\n### Current Behavior\n\nCheckboxes in django admin superuser no longer generated with an associated label.\n\n### Expected Behavior\n\nExpect to see accessible checkboxes in django admin, no missing columns in either superuser or staff views.\n\n### Steps to Reproduce\n\n1. Log in as superuser\r\n2. Go to list view on a model\r\n3. Run ANDI  or inspect checkboxes\r\n\n\n### Environment\n\n_No response_\n\n### Additional Context\n\nTraced this to the fix for missing columns in staff view. The check {% if results.0.form %} did not work and failed silently. Have a fix for this.\r\n\r\nWill prioritize implementation and deployment to staging since we have some accessibility testing in progress.\n\n### Issue Links\n\n_No response_\n", "before_files": [{"content": "from django import template\nimport re\n\nregister = template.Library()\n\n\n@register.filter(name=\"extract_value\")\ndef extract_value(html_input):\n    match = re.search(r'value=\"([^\"]*)\"', html_input)\n    if match:\n        return match.group(1)\n    return \"\"\n\n\n@register.filter\ndef extract_a_text(value):\n    # Use regex to extract the text within the <a> tag\n    pattern = r\"<a\\b[^>]*>(.*?)</a>\"\n    match = re.search(pattern, value)\n    if match:\n        extracted_text = match.group(1)\n    else:\n        extracted_text = \"\"\n\n    return extracted_text\n\n\n@register.filter\ndef find_index(haystack, needle):\n    try:\n        return haystack.index(needle)\n    except ValueError:\n        return -1\n\n\n@register.filter\ndef slice_after(value, substring):\n    index = value.find(substring)\n    if index != -1:\n        result = value[index + len(substring) :]\n        return result\n    return value\n", "path": "src/registrar/templatetags/custom_filters.py"}], "after_files": [{"content": "from django import template\nimport re\n\nregister = template.Library()\n\n\n@register.filter(name=\"extract_value\")\ndef extract_value(html_input):\n    match = re.search(r'value=\"([^\"]*)\"', html_input)\n    if match:\n        return match.group(1)\n    return \"\"\n\n\n@register.filter\ndef extract_a_text(value):\n    # Use regex to extract the text within the <a> tag\n    pattern = r\"<a\\b[^>]*>(.*?)</a>\"\n    match = re.search(pattern, value)\n    if match:\n        extracted_text = match.group(1)\n    else:\n        extracted_text = \"\"\n\n    return extracted_text\n\n\n@register.filter\ndef find_index(haystack, needle):\n    try:\n        return haystack.index(needle)\n    except ValueError:\n        return -1\n\n\n@register.filter\ndef slice_after(value, substring):\n    index = value.find(substring)\n    if index != -1:\n        result = value[index + len(substring) :]\n        return result\n    return value\n\n\n@register.filter\ndef contains_checkbox(html_list):\n    for html_string in html_list:\n        if re.search(r'<input[^>]*type=\"checkbox\"', html_string):\n            return True\n    return False\n", "path": "src/registrar/templatetags/custom_filters.py"}]}