We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Bug: Internal Server Error: /fiscal/organizations/
Production issue.

```
FieldError at /fiscal/organizations/
Cannot resolve keyword 'membership' into field. Choices are: administered_events, affiliated_organizations, country, domain, fullname, hosted_events, id, latitude, longitude, member, memberships, selforganisedsubmission, sponsored_events, workshopinquiryrequest, workshoprequest
```

https://amy.carpentries.org/fiscal/organizations/?country=&membership__variant=silver&order_by=

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `amy/fiscal/filters.py`
Content:
```
1 from datetime import date
2 
3 from django.forms import widgets
4 import django_filters
5 
6 from workshops.fields import Select2MultipleWidget, Select2Widget
7 from workshops.filters import AllCountriesFilter, AMYFilterSet
8 from workshops.models import Membership, Organization
9 
10 
11 class OrganizationFilter(AMYFilterSet):
12     country = AllCountriesFilter(widget=Select2Widget)
13 
14     membership__variant = django_filters.MultipleChoiceFilter(
15         label="Memberships (current or past)",
16         choices=Membership.MEMBERSHIP_CHOICES,
17         widget=Select2MultipleWidget,
18     )
19 
20     order_by = django_filters.OrderingFilter(
21         fields=(
22             "fullname",
23             "domain",
24         ),
25     )
26 
27     class Meta:
28         model = Organization
29         fields = [
30             "country",
31         ]
32 
33 
34 def filter_active_memberships_only(queryset, name, active):
35     """Limit Memberships to only active entries."""
36     if active:
37         today = date.today()
38         return queryset.filter(agreement_start__lte=today, agreement_end__gte=today)
39     else:
40         return queryset
41 
42 
43 def filter_training_seats_only(queryset, name, seats):
44     """Limit Memberships to only entries with some training seats allowed."""
45     if seats:
46         return queryset.filter(instructor_training_seats_total__gt=0)
47     else:
48         return queryset
49 
50 
51 def filter_nonpositive_remaining_seats(queryset, name, seats):
52     """Limit Memberships to only entries with negative remaining seats."""
53     if seats:
54         return queryset.filter(instructor_training_seats_remaining__lt=0)
55     else:
56         return queryset
57 
58 
59 class MembershipFilter(AMYFilterSet):
60     organization_name = django_filters.CharFilter(
61         label="Organisation name",
62         field_name="organizations__fullname",
63         lookup_expr="icontains",
64     )
65 
66     MEMBERSHIP_CHOICES = (("", "Any"),) + Membership.MEMBERSHIP_CHOICES
67     variant = django_filters.ChoiceFilter(choices=MEMBERSHIP_CHOICES)
68 
69     CONTRIBUTION_CHOICES = (("", "Any"),) + Membership.CONTRIBUTION_CHOICES
70     contribution_type = django_filters.ChoiceFilter(choices=CONTRIBUTION_CHOICES)
71 
72     active_only = django_filters.BooleanFilter(
73         label="Only show active memberships",
74         method=filter_active_memberships_only,
75         widget=widgets.CheckboxInput,
76     )
77 
78     training_seats_only = django_filters.BooleanFilter(
79         label="Only show memberships with non-zero allowed training seats",
80         method=filter_training_seats_only,
81         widget=widgets.CheckboxInput,
82     )
83 
84     nonpositive_remaining_seats_only = django_filters.BooleanFilter(
85         label="Only show memberships with zero or less remaining seats",
86         method=filter_nonpositive_remaining_seats,
87         widget=widgets.CheckboxInput,
88     )
89 
90     order_by = django_filters.OrderingFilter(
91         fields=(
92             "agreement_start",
93             "agreement_end",
94             "instructor_training_seats_remaining",
95         ),
96     )
97 
98     class Meta:
99         model = Membership
100         fields = [
101             "organization_name",
102             "consortium",
103             "public_status",
104             "variant",
105             "contribution_type",
106         ]
107 
108 
109 class MembershipTrainingsFilter(AMYFilterSet):
110     organization_name = django_filters.CharFilter(
111         label="Organization name",
112         field_name="organization__fullname",
113         lookup_expr="icontains",
114     )
115 
116     active_only = django_filters.BooleanFilter(
117         label="Only show active memberships",
118         method=filter_active_memberships_only,
119         widget=widgets.CheckboxInput,
120     )
121 
122     training_seats_only = django_filters.BooleanFilter(
123         label="Only show memberships with non-zero allowed training seats",
124         method=filter_training_seats_only,
125         widget=widgets.CheckboxInput,
126     )
127 
128     nonpositive_remaining_seats_only = django_filters.BooleanFilter(
129         label="Only show memberships with zero or less remaining seats",
130         method=filter_nonpositive_remaining_seats,
131         widget=widgets.CheckboxInput,
132     )
133 
134     order_by = django_filters.OrderingFilter(
135         fields=(
136             "organization__fullname",
137             "organization__domain",
138             "agreement_start",
139             "agreement_end",
140             "instructor_training_seats_total",
141             "instructor_training_seats_utilized",
142             "instructor_training_seats_remaining",
143         ),
144     )
145 
146     class Meta:
147         model = Membership
148         fields = [
149             "organization_name",
150         ]
151
```
--- 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()

```

diff --git a/amy/fiscal/filters.py b/amy/fiscal/filters.py
--- a/amy/fiscal/filters.py
+++ b/amy/fiscal/filters.py
@@ -11,7 +11,7 @@
 class OrganizationFilter(AMYFilterSet):
     country = AllCountriesFilter(widget=Select2Widget)
 
-    membership__variant = django_filters.MultipleChoiceFilter(
+    memberships__variant = django_filters.MultipleChoiceFilter(
         label="Memberships (current or past)",
         choices=Membership.MEMBERSHIP_CHOICES,
         widget=Select2MultipleWidget,

{"golden_diff": "diff --git a/amy/fiscal/filters.py b/amy/fiscal/filters.py\n--- a/amy/fiscal/filters.py\n+++ b/amy/fiscal/filters.py\n@@ -11,7 +11,7 @@\n class OrganizationFilter(AMYFilterSet):\n     country = AllCountriesFilter(widget=Select2Widget)\n \n-    membership__variant = django_filters.MultipleChoiceFilter(\n+    memberships__variant = django_filters.MultipleChoiceFilter(\n         label=\"Memberships (current or past)\",\n         choices=Membership.MEMBERSHIP_CHOICES,\n         widget=Select2MultipleWidget,\n", "issue": "Bug: Internal Server Error: /fiscal/organizations/\nProduction issue.\r\n\r\n```\r\nFieldError at /fiscal/organizations/\r\nCannot resolve keyword 'membership' into field. Choices are: administered_events, affiliated_organizations, country, domain, fullname, hosted_events, id, latitude, longitude, member, memberships, selforganisedsubmission, sponsored_events, workshopinquiryrequest, workshoprequest\r\n```\r\n\r\nhttps://amy.carpentries.org/fiscal/organizations/?country=&membership__variant=silver&order_by=\n", "before_files": [{"content": "from datetime import date\n\nfrom django.forms import widgets\nimport django_filters\n\nfrom workshops.fields import Select2MultipleWidget, Select2Widget\nfrom workshops.filters import AllCountriesFilter, AMYFilterSet\nfrom workshops.models import Membership, Organization\n\n\nclass OrganizationFilter(AMYFilterSet):\n    country = AllCountriesFilter(widget=Select2Widget)\n\n    membership__variant = django_filters.MultipleChoiceFilter(\n        label=\"Memberships (current or past)\",\n        choices=Membership.MEMBERSHIP_CHOICES,\n        widget=Select2MultipleWidget,\n    )\n\n    order_by = django_filters.OrderingFilter(\n        fields=(\n            \"fullname\",\n            \"domain\",\n        ),\n    )\n\n    class Meta:\n        model = Organization\n        fields = [\n            \"country\",\n        ]\n\n\ndef filter_active_memberships_only(queryset, name, active):\n    \"\"\"Limit Memberships to only active entries.\"\"\"\n    if active:\n        today = date.today()\n        return queryset.filter(agreement_start__lte=today, agreement_end__gte=today)\n    else:\n        return queryset\n\n\ndef filter_training_seats_only(queryset, name, seats):\n    \"\"\"Limit Memberships to only entries with some training seats allowed.\"\"\"\n    if seats:\n        return queryset.filter(instructor_training_seats_total__gt=0)\n    else:\n        return queryset\n\n\ndef filter_nonpositive_remaining_seats(queryset, name, seats):\n    \"\"\"Limit Memberships to only entries with negative remaining seats.\"\"\"\n    if seats:\n        return queryset.filter(instructor_training_seats_remaining__lt=0)\n    else:\n        return queryset\n\n\nclass MembershipFilter(AMYFilterSet):\n    organization_name = django_filters.CharFilter(\n        label=\"Organisation name\",\n        field_name=\"organizations__fullname\",\n        lookup_expr=\"icontains\",\n    )\n\n    MEMBERSHIP_CHOICES = ((\"\", \"Any\"),) + Membership.MEMBERSHIP_CHOICES\n    variant = django_filters.ChoiceFilter(choices=MEMBERSHIP_CHOICES)\n\n    CONTRIBUTION_CHOICES = ((\"\", \"Any\"),) + Membership.CONTRIBUTION_CHOICES\n    contribution_type = django_filters.ChoiceFilter(choices=CONTRIBUTION_CHOICES)\n\n    active_only = django_filters.BooleanFilter(\n        label=\"Only show active memberships\",\n        method=filter_active_memberships_only,\n        widget=widgets.CheckboxInput,\n    )\n\n    training_seats_only = django_filters.BooleanFilter(\n        label=\"Only show memberships with non-zero allowed training seats\",\n        method=filter_training_seats_only,\n        widget=widgets.CheckboxInput,\n    )\n\n    nonpositive_remaining_seats_only = django_filters.BooleanFilter(\n        label=\"Only show memberships with zero or less remaining seats\",\n        method=filter_nonpositive_remaining_seats,\n        widget=widgets.CheckboxInput,\n    )\n\n    order_by = django_filters.OrderingFilter(\n        fields=(\n            \"agreement_start\",\n            \"agreement_end\",\n            \"instructor_training_seats_remaining\",\n        ),\n    )\n\n    class Meta:\n        model = Membership\n        fields = [\n            \"organization_name\",\n            \"consortium\",\n            \"public_status\",\n            \"variant\",\n            \"contribution_type\",\n        ]\n\n\nclass MembershipTrainingsFilter(AMYFilterSet):\n    organization_name = django_filters.CharFilter(\n        label=\"Organization name\",\n        field_name=\"organization__fullname\",\n        lookup_expr=\"icontains\",\n    )\n\n    active_only = django_filters.BooleanFilter(\n        label=\"Only show active memberships\",\n        method=filter_active_memberships_only,\n        widget=widgets.CheckboxInput,\n    )\n\n    training_seats_only = django_filters.BooleanFilter(\n        label=\"Only show memberships with non-zero allowed training seats\",\n        method=filter_training_seats_only,\n        widget=widgets.CheckboxInput,\n    )\n\n    nonpositive_remaining_seats_only = django_filters.BooleanFilter(\n        label=\"Only show memberships with zero or less remaining seats\",\n        method=filter_nonpositive_remaining_seats,\n        widget=widgets.CheckboxInput,\n    )\n\n    order_by = django_filters.OrderingFilter(\n        fields=(\n            \"organization__fullname\",\n            \"organization__domain\",\n            \"agreement_start\",\n            \"agreement_end\",\n            \"instructor_training_seats_total\",\n            \"instructor_training_seats_utilized\",\n            \"instructor_training_seats_remaining\",\n        ),\n    )\n\n    class Meta:\n        model = Membership\n        fields = [\n            \"organization_name\",\n        ]\n", "path": "amy/fiscal/filters.py"}], "after_files": [{"content": "from datetime import date\n\nfrom django.forms import widgets\nimport django_filters\n\nfrom workshops.fields import Select2MultipleWidget, Select2Widget\nfrom workshops.filters import AllCountriesFilter, AMYFilterSet\nfrom workshops.models import Membership, Organization\n\n\nclass OrganizationFilter(AMYFilterSet):\n    country = AllCountriesFilter(widget=Select2Widget)\n\n    memberships__variant = django_filters.MultipleChoiceFilter(\n        label=\"Memberships (current or past)\",\n        choices=Membership.MEMBERSHIP_CHOICES,\n        widget=Select2MultipleWidget,\n    )\n\n    order_by = django_filters.OrderingFilter(\n        fields=(\n            \"fullname\",\n            \"domain\",\n        ),\n    )\n\n    class Meta:\n        model = Organization\n        fields = [\n            \"country\",\n        ]\n\n\ndef filter_active_memberships_only(queryset, name, active):\n    \"\"\"Limit Memberships to only active entries.\"\"\"\n    if active:\n        today = date.today()\n        return queryset.filter(agreement_start__lte=today, agreement_end__gte=today)\n    else:\n        return queryset\n\n\ndef filter_training_seats_only(queryset, name, seats):\n    \"\"\"Limit Memberships to only entries with some training seats allowed.\"\"\"\n    if seats:\n        return queryset.filter(instructor_training_seats_total__gt=0)\n    else:\n        return queryset\n\n\ndef filter_nonpositive_remaining_seats(queryset, name, seats):\n    \"\"\"Limit Memberships to only entries with negative remaining seats.\"\"\"\n    if seats:\n        return queryset.filter(instructor_training_seats_remaining__lt=0)\n    else:\n        return queryset\n\n\nclass MembershipFilter(AMYFilterSet):\n    organization_name = django_filters.CharFilter(\n        label=\"Organisation name\",\n        field_name=\"organizations__fullname\",\n        lookup_expr=\"icontains\",\n    )\n\n    MEMBERSHIP_CHOICES = ((\"\", \"Any\"),) + Membership.MEMBERSHIP_CHOICES\n    variant = django_filters.ChoiceFilter(choices=MEMBERSHIP_CHOICES)\n\n    CONTRIBUTION_CHOICES = ((\"\", \"Any\"),) + Membership.CONTRIBUTION_CHOICES\n    contribution_type = django_filters.ChoiceFilter(choices=CONTRIBUTION_CHOICES)\n\n    active_only = django_filters.BooleanFilter(\n        label=\"Only show active memberships\",\n        method=filter_active_memberships_only,\n        widget=widgets.CheckboxInput,\n    )\n\n    training_seats_only = django_filters.BooleanFilter(\n        label=\"Only show memberships with non-zero allowed training seats\",\n        method=filter_training_seats_only,\n        widget=widgets.CheckboxInput,\n    )\n\n    nonpositive_remaining_seats_only = django_filters.BooleanFilter(\n        label=\"Only show memberships with zero or less remaining seats\",\n        method=filter_nonpositive_remaining_seats,\n        widget=widgets.CheckboxInput,\n    )\n\n    order_by = django_filters.OrderingFilter(\n        fields=(\n            \"agreement_start\",\n            \"agreement_end\",\n            \"instructor_training_seats_remaining\",\n        ),\n    )\n\n    class Meta:\n        model = Membership\n        fields = [\n            \"organization_name\",\n            \"consortium\",\n            \"public_status\",\n            \"variant\",\n            \"contribution_type\",\n        ]\n\n\nclass MembershipTrainingsFilter(AMYFilterSet):\n    organization_name = django_filters.CharFilter(\n        label=\"Organization name\",\n        field_name=\"organization__fullname\",\n        lookup_expr=\"icontains\",\n    )\n\n    active_only = django_filters.BooleanFilter(\n        label=\"Only show active memberships\",\n        method=filter_active_memberships_only,\n        widget=widgets.CheckboxInput,\n    )\n\n    training_seats_only = django_filters.BooleanFilter(\n        label=\"Only show memberships with non-zero allowed training seats\",\n        method=filter_training_seats_only,\n        widget=widgets.CheckboxInput,\n    )\n\n    nonpositive_remaining_seats_only = django_filters.BooleanFilter(\n        label=\"Only show memberships with zero or less remaining seats\",\n        method=filter_nonpositive_remaining_seats,\n        widget=widgets.CheckboxInput,\n    )\n\n    order_by = django_filters.OrderingFilter(\n        fields=(\n            \"organization__fullname\",\n            \"organization__domain\",\n            \"agreement_start\",\n            \"agreement_end\",\n            \"instructor_training_seats_total\",\n            \"instructor_training_seats_utilized\",\n            \"instructor_training_seats_remaining\",\n        ),\n    )\n\n    class Meta:\n        model = Membership\n        fields = [\n            \"organization_name\",\n        ]\n", "path": "amy/fiscal/filters.py"}]}