prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Unsupported upload interface type breaks later file uploads widgets
  I have a reader study with a 3d-liver-model interface (.obj kind). The following likely also extends to archive items.
  
  We don't support uploading these via the UI.
  
  However, when one of these interfaces is present all subsequent file upload widgets are not loaded on page: https://grand-challenge.org/reader-studies/chris-test-reader-study-the-second-coming/display-sets/create-single/
  
  ![image](https://github.com/comic/grand-challenge.org/assets/7871310/7b167978-def3-46b3-b301-ecb9cda7b24e)
  
  I've since removed the display set with the interface to quickly do a workaround.
  
  Not sure if this needs to be fixed or is so corner case that we can safely ignore it.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `app/grandchallenge/uploads/widgets.py`
  Content:
  ```
  1 from django.forms.widgets import HiddenInput, MultipleHiddenInput
  2 
  3 
  4 class UserUploadWidgetMixin:
  5     template_name = "uploads/widget.html"
  6     input_type = None
  7 
  8     def __init__(self, *args, allowed_file_types=None, **kwargs):
  9         super().__init__(*args, **kwargs)
  10         self.allowed_file_types = allowed_file_types
  11 
  12     def get_context(self, *args, **kwargs):
  13         context = super().get_context(*args, **kwargs)
  14         context["widget"]["allowed_file_types"] = {
  15             "id": f"{context['widget']['attrs']['id']}AllowedFileTypes",
  16             "value": self.allowed_file_types,
  17         }
  18         return context
  19 
  20     class Media:
  21         css = {"all": ("vendored/uppy/uppy.min.css",)}
  22         js = (
  23             "vendored/uppy/uppy.min.js",
  24             "js/user_upload.js",
  25         )
  26 
  27 
  28 class UserUploadSingleWidget(UserUploadWidgetMixin, HiddenInput):
  29     pass
  30 
  31 
  32 class UserUploadMultipleWidget(UserUploadWidgetMixin, MultipleHiddenInput):
  33     def get_context(self, name, value, attrs):
  34         context = super().get_context(name, value, attrs)
  35         context["widget"]["attrs"]["multiple"] = True
  36         return context
  37
  ```
  --- 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/app/grandchallenge/uploads/widgets.py b/app/grandchallenge/uploads/widgets.py
  --- a/app/grandchallenge/uploads/widgets.py
  +++ b/app/grandchallenge/uploads/widgets.py
  @@ -11,8 +11,10 @@
   
       def get_context(self, *args, **kwargs):
           context = super().get_context(*args, **kwargs)
  +        widget_id = f'X_{context["widget"]["attrs"]["id"]}'
  +        context["widget"]["attrs"]["id"] = widget_id
           context["widget"]["allowed_file_types"] = {
  -            "id": f"{context['widget']['attrs']['id']}AllowedFileTypes",
  +            "id": f"{widget_id}AllowedFileTypes",
               "value": self.allowed_file_types,
           }
           return context
  
verification_info: {"golden_diff": "diff --git a/app/grandchallenge/uploads/widgets.py b/app/grandchallenge/uploads/widgets.py\n--- a/app/grandchallenge/uploads/widgets.py\n+++ b/app/grandchallenge/uploads/widgets.py\n@@ -11,8 +11,10 @@\n \n     def get_context(self, *args, **kwargs):\n         context = super().get_context(*args, **kwargs)\n+        widget_id = f'X_{context[\"widget\"][\"attrs\"][\"id\"]}'\n+        context[\"widget\"][\"attrs\"][\"id\"] = widget_id\n         context[\"widget\"][\"allowed_file_types\"] = {\n-            \"id\": f\"{context['widget']['attrs']['id']}AllowedFileTypes\",\n+            \"id\": f\"{widget_id}AllowedFileTypes\",\n             \"value\": self.allowed_file_types,\n         }\n         return context\n", "issue": "Unsupported upload interface type breaks later file uploads widgets\nI have a reader study with a 3d-liver-model interface (.obj kind). The following likely also extends to archive items.\r\n\r\nWe don't support uploading these via the UI.\r\n\r\nHowever, when one of these interfaces is present all subsequent file upload widgets are not loaded on page: https://grand-challenge.org/reader-studies/chris-test-reader-study-the-second-coming/display-sets/create-single/\r\n\r\n![image](https://github.com/comic/grand-challenge.org/assets/7871310/7b167978-def3-46b3-b301-ecb9cda7b24e)\r\n\r\nI've since removed the display set with the interface to quickly do a workaround.\r\n\r\nNot sure if this needs to be fixed or is so corner case that we can safely ignore it.\n", "before_files": [{"content": "from django.forms.widgets import HiddenInput, MultipleHiddenInput\n\n\nclass UserUploadWidgetMixin:\n    template_name = \"uploads/widget.html\"\n    input_type = None\n\n    def __init__(self, *args, allowed_file_types=None, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.allowed_file_types = allowed_file_types\n\n    def get_context(self, *args, **kwargs):\n        context = super().get_context(*args, **kwargs)\n        context[\"widget\"][\"allowed_file_types\"] = {\n            \"id\": f\"{context['widget']['attrs']['id']}AllowedFileTypes\",\n            \"value\": self.allowed_file_types,\n        }\n        return context\n\n    class Media:\n        css = {\"all\": (\"vendored/uppy/uppy.min.css\",)}\n        js = (\n            \"vendored/uppy/uppy.min.js\",\n            \"js/user_upload.js\",\n        )\n\n\nclass UserUploadSingleWidget(UserUploadWidgetMixin, HiddenInput):\n    pass\n\n\nclass UserUploadMultipleWidget(UserUploadWidgetMixin, MultipleHiddenInput):\n    def get_context(self, name, value, attrs):\n        context = super().get_context(name, value, attrs)\n        context[\"widget\"][\"attrs\"][\"multiple\"] = True\n        return context\n", "path": "app/grandchallenge/uploads/widgets.py"}], "after_files": [{"content": "from django.forms.widgets import HiddenInput, MultipleHiddenInput\n\n\nclass UserUploadWidgetMixin:\n    template_name = \"uploads/widget.html\"\n    input_type = None\n\n    def __init__(self, *args, allowed_file_types=None, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.allowed_file_types = allowed_file_types\n\n    def get_context(self, *args, **kwargs):\n        context = super().get_context(*args, **kwargs)\n        widget_id = f'X_{context[\"widget\"][\"attrs\"][\"id\"]}'\n        context[\"widget\"][\"attrs\"][\"id\"] = widget_id\n        context[\"widget\"][\"allowed_file_types\"] = {\n            \"id\": f\"{widget_id}AllowedFileTypes\",\n            \"value\": self.allowed_file_types,\n        }\n        return context\n\n    class Media:\n        css = {\"all\": (\"vendored/uppy/uppy.min.css\",)}\n        js = (\n            \"vendored/uppy/uppy.min.js\",\n            \"js/user_upload.js\",\n        )\n\n\nclass UserUploadSingleWidget(UserUploadWidgetMixin, HiddenInput):\n    pass\n\n\nclass UserUploadMultipleWidget(UserUploadWidgetMixin, MultipleHiddenInput):\n    def get_context(self, name, value, attrs):\n        context = super().get_context(name, value, attrs)\n        context[\"widget\"][\"attrs\"][\"multiple\"] = True\n        return context\n", "path": "app/grandchallenge/uploads/widgets.py"}]}