prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Annual documents does not show drop-down menu for year
  ### Describe the bug
  
  When I try to add an annual document to the site, I am not able to select a year, the dropdown menu does not contain any entries. 
  
  ### Steps to reproduce
  
  1. 
  
  </issue>
  <code>
  [start of website/documents/forms.py]
  1 """The forms defined by the documents package."""
  2 from django import forms
  3 from django.contrib import admin
  4 from django.forms import widgets
  5 from django.utils import timezone
  6 
  7 from documents import models
  8 from utils.snippets import datetime_to_lectureyear
  9 
  10 
  11 class DocumentFileInput(widgets.ClearableFileInput):
  12     """Wrapper around Django's :class:`~django.forms.widgets.ClearableFileInput`.
  13 
  14     It overrides the URL of the associated file when it is fetched.
  15     """
  16 
  17     template_name = "widgets/clearable_file_input.html"
  18 
  19     def get_context(self, name, value, attrs):
  20         context = super().get_context(name, value, attrs)
  21         if hasattr(value, "url"):
  22             doc = models.Document.objects.get(file=value)
  23             context["document_id"] = doc.pk
  24             context["language"] = "en"
  25         return context
  26 
  27 
  28 class MinutesForm(forms.ModelForm):
  29     """Form that overrides the widgets for the files."""
  30 
  31     class Meta:
  32         model = models.Minutes
  33         fields = (
  34             "file",
  35             "members_only",
  36         )
  37         widgets = {
  38             "file": DocumentFileInput,
  39         }
  40 
  41 
  42 class AnnualDocumentForm(forms.ModelForm):
  43     """Form that provides custom functionality for annual documents."""
  44 
  45     class Meta:
  46         model = models.AnnualDocument
  47         fields = "__all__"
  48         widgets = {
  49             "year": forms.Select,
  50             "file": DocumentFileInput,
  51         }
  52 
  53     @staticmethod
  54     def _current_year():
  55         """Get the current lecture year."""
  56         return datetime_to_lectureyear(timezone.now())
  57 
  58     @staticmethod
  59     def _year_choices():
  60         """Get the lecture years."""
  61         current = datetime_to_lectureyear(timezone.now())
  62         return [
  63             (year, "{}-{}".format(year, year + 1))
  64             for year in range(current + 1, 1989, -1)
  65         ]
  66 
  67 
  68 class AssociationDocumentForm(forms.ModelForm):
  69     """Form that overrides the widgets for the files."""
  70 
  71     class Meta:
  72         model = models.AssociationDocument
  73         fields = (
  74             "name",
  75             "file",
  76             "members_only",
  77         )
  78         widgets = {
  79             "file": DocumentFileInput,
  80         }
  81 
  82 
  83 class EventDocumentForm(forms.ModelForm):
  84     """Form that overrides the widgets for the files."""
  85 
  86     class Meta:
  87         model = models.EventDocument
  88         fields = (
  89             "name",
  90             "file",
  91             "members_only",
  92             "owner",
  93         )
  94         widgets = {
  95             "file": DocumentFileInput,
  96         }
  97 
  98 
  99 class MiscellaneousDocumentForm(forms.ModelForm):
  100     """Form that overrides the widgets for the files."""
  101 
  102     class Meta:
  103         model = models.MiscellaneousDocument
  104         fields = (
  105             "name",
  106             "file",
  107             "members_only",
  108         )
  109         widgets = {
  110             "file": DocumentFileInput,
  111         }
  112 
  113 
  114 class GeneralMeetingForm(forms.ModelForm):
  115     """Custom form for general meetings with a custom widget for documents."""
  116 
  117     class Meta:
  118         model = models.GeneralMeeting
  119         fields = "__all__"
  120         widgets = {
  121             "documents": admin.widgets.FilteredSelectMultiple(
  122                 "documents", is_stacked=False
  123             )
  124         }
  125
  [end of website/documents/forms.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/website/documents/forms.py b/website/documents/forms.py
  --- a/website/documents/forms.py
  +++ b/website/documents/forms.py
  @@ -64,6 +64,10 @@
               for year in range(current + 1, 1989, -1)
           ]
   
  +    year = forms.TypedChoiceField(
  +        coerce=int, choices=_year_choices.__func__, initial=_current_year.__func__
  +    )
  +
   
   class AssociationDocumentForm(forms.ModelForm):
       """Form that overrides the widgets for the files."""
  
verification_info: {"golden_diff": "diff --git a/website/documents/forms.py b/website/documents/forms.py\n--- a/website/documents/forms.py\n+++ b/website/documents/forms.py\n@@ -64,6 +64,10 @@\n             for year in range(current + 1, 1989, -1)\n         ]\n \n+    year = forms.TypedChoiceField(\n+        coerce=int, choices=_year_choices.__func__, initial=_current_year.__func__\n+    )\n+\n \n class AssociationDocumentForm(forms.ModelForm):\n     \"\"\"Form that overrides the widgets for the files.\"\"\"\n", "issue": "Annual documents does not show drop-down menu for year\n### Describe the bug\r\n\r\nWhen I try to add an annual document to the site, I am not able to select a year, the dropdown menu does not contain any entries. \r\n\r\n### Steps to reproduce\r\n\r\n1. \n", "before_files": [{"content": "\"\"\"The forms defined by the documents package.\"\"\"\nfrom django import forms\nfrom django.contrib import admin\nfrom django.forms import widgets\nfrom django.utils import timezone\n\nfrom documents import models\nfrom utils.snippets import datetime_to_lectureyear\n\n\nclass DocumentFileInput(widgets.ClearableFileInput):\n    \"\"\"Wrapper around Django's :class:`~django.forms.widgets.ClearableFileInput`.\n\n    It overrides the URL of the associated file when it is fetched.\n    \"\"\"\n\n    template_name = \"widgets/clearable_file_input.html\"\n\n    def get_context(self, name, value, attrs):\n        context = super().get_context(name, value, attrs)\n        if hasattr(value, \"url\"):\n            doc = models.Document.objects.get(file=value)\n            context[\"document_id\"] = doc.pk\n            context[\"language\"] = \"en\"\n        return context\n\n\nclass MinutesForm(forms.ModelForm):\n    \"\"\"Form that overrides the widgets for the files.\"\"\"\n\n    class Meta:\n        model = models.Minutes\n        fields = (\n            \"file\",\n            \"members_only\",\n        )\n        widgets = {\n            \"file\": DocumentFileInput,\n        }\n\n\nclass AnnualDocumentForm(forms.ModelForm):\n    \"\"\"Form that provides custom functionality for annual documents.\"\"\"\n\n    class Meta:\n        model = models.AnnualDocument\n        fields = \"__all__\"\n        widgets = {\n            \"year\": forms.Select,\n            \"file\": DocumentFileInput,\n        }\n\n    @staticmethod\n    def _current_year():\n        \"\"\"Get the current lecture year.\"\"\"\n        return datetime_to_lectureyear(timezone.now())\n\n    @staticmethod\n    def _year_choices():\n        \"\"\"Get the lecture years.\"\"\"\n        current = datetime_to_lectureyear(timezone.now())\n        return [\n            (year, \"{}-{}\".format(year, year + 1))\n            for year in range(current + 1, 1989, -1)\n        ]\n\n\nclass AssociationDocumentForm(forms.ModelForm):\n    \"\"\"Form that overrides the widgets for the files.\"\"\"\n\n    class Meta:\n        model = models.AssociationDocument\n        fields = (\n            \"name\",\n            \"file\",\n            \"members_only\",\n        )\n        widgets = {\n            \"file\": DocumentFileInput,\n        }\n\n\nclass EventDocumentForm(forms.ModelForm):\n    \"\"\"Form that overrides the widgets for the files.\"\"\"\n\n    class Meta:\n        model = models.EventDocument\n        fields = (\n            \"name\",\n            \"file\",\n            \"members_only\",\n            \"owner\",\n        )\n        widgets = {\n            \"file\": DocumentFileInput,\n        }\n\n\nclass MiscellaneousDocumentForm(forms.ModelForm):\n    \"\"\"Form that overrides the widgets for the files.\"\"\"\n\n    class Meta:\n        model = models.MiscellaneousDocument\n        fields = (\n            \"name\",\n            \"file\",\n            \"members_only\",\n        )\n        widgets = {\n            \"file\": DocumentFileInput,\n        }\n\n\nclass GeneralMeetingForm(forms.ModelForm):\n    \"\"\"Custom form for general meetings with a custom widget for documents.\"\"\"\n\n    class Meta:\n        model = models.GeneralMeeting\n        fields = \"__all__\"\n        widgets = {\n            \"documents\": admin.widgets.FilteredSelectMultiple(\n                \"documents\", is_stacked=False\n            )\n        }\n", "path": "website/documents/forms.py"}]}