We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Hide lesson program specific checkout steps
Now that we have a single Instructor badge, we do not want to see the lesson program specific checkout steps. These should be hidden from view so only four options remain.

- ~DC Demo~
- ~DC Homework~
- Demo
- Discussion
- Homework
- ~LC Demo~
- ~LC Homework~
- ~SWC Demo~
- ~SWC Homework~
- Training

--- 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/trainings/forms.py`
Content:
```
1 from crispy_forms.layout import Layout, Submit
2 from django import forms
3 from django.core.exceptions import ValidationError
4 from django.db.models import Q
5 from django.forms import RadioSelect, TextInput
6 
7 # this is used instead of Django Autocomplete Light widgets
8 # see issue #1330: https://github.com/swcarpentry/amy/issues/1330
9 from workshops.fields import ModelSelect2Widget
10 from workshops.forms import SELECT2_SIDEBAR, BootstrapHelper
11 from workshops.models import Event, Person, TrainingProgress, TrainingRequirement
12 
13 
14 class TrainingProgressForm(forms.ModelForm):
15     trainee = forms.ModelChoiceField(
16         label="Trainee",
17         required=True,
18         queryset=Person.objects.all(),
19         widget=ModelSelect2Widget(data_view="person-lookup"),
20     )
21     evaluated_by = forms.ModelChoiceField(
22         label="Evaluated by",
23         required=False,
24         queryset=Person.objects.all(),
25         widget=ModelSelect2Widget(data_view="admin-lookup"),
26     )
27     event = forms.ModelChoiceField(
28         label="Event",
29         required=False,
30         queryset=Event.objects.all(),
31         widget=ModelSelect2Widget(data_view="event-lookup", attrs=SELECT2_SIDEBAR),
32     )
33 
34     # helper used in edit view
35     helper = BootstrapHelper(
36         duplicate_buttons_on_top=True,
37         submit_label="Update",
38         add_delete_button=True,
39         additional_form_class="training-progress",
40         add_cancel_button=False,
41     )
42 
43     # helper used in create view
44     create_helper = BootstrapHelper(
45         duplicate_buttons_on_top=True,
46         submit_label="Add",
47         additional_form_class="training-progress",
48         add_cancel_button=False,
49     )
50 
51     class Meta:
52         model = TrainingProgress
53         fields = [
54             "trainee",
55             "evaluated_by",
56             "requirement",
57             "state",
58             "discarded",
59             "event",
60             "url",
61             "notes",
62         ]
63         widgets = {
64             "state": RadioSelect,
65         }
66 
67     def clean(self):
68         cleaned_data = super().clean()
69 
70         trainee = cleaned_data.get("trainee")
71 
72         # check if trainee has at least one training task
73         training_tasks = trainee.get_training_tasks()
74 
75         if not training_tasks:
76             raise ValidationError(
77                 "It's not possible to add training progress "
78                 "to a trainee without any training task."
79             )
80 
81 
82 class BulkAddTrainingProgressForm(forms.ModelForm):
83     event = forms.ModelChoiceField(
84         label="Training",
85         required=False,
86         queryset=Event.objects.filter(tags__name="TTT"),
87         widget=ModelSelect2Widget(data_view="ttt-event-lookup", attrs=SELECT2_SIDEBAR),
88     )
89 
90     trainees = forms.ModelMultipleChoiceField(queryset=Person.objects.all())
91 
92     requirement = forms.ModelChoiceField(
93         queryset=TrainingRequirement.objects.exclude(
94             Q(name__startswith="SWC")
95             | Q(name__startswith="DC")
96             | Q(name__startswith="LC")
97         ),
98         label="Type",
99         required=True,
100     )
101 
102     helper = BootstrapHelper(
103         additional_form_class="training-progress",
104         submit_label="Add",
105         form_tag=False,
106         add_cancel_button=False,
107     )
108     helper.layout = Layout(
109         # no 'trainees' -- you should take care of generating it manually in
110         # the template where this form is used
111         "requirement",
112         "state",
113         "event",
114         "url",
115         "notes",
116     )
117 
118     class Meta:
119         model = TrainingProgress
120         fields = [
121             # no 'trainees'
122             "requirement",
123             "state",
124             "event",
125             "url",
126             "notes",
127         ]
128         widgets = {
129             "state": RadioSelect,
130             "notes": TextInput,
131         }
132 
133     def clean(self):
134         cleaned_data = super().clean()
135 
136         trainees = cleaned_data.get("trainees", [])
137 
138         # check if all trainees have at least one training task
139         for trainee in trainees:
140             training_tasks = trainee.get_training_tasks()
141 
142             if not training_tasks:
143                 raise ValidationError(
144                     "It's not possible to add training "
145                     "progress to a trainee without any "
146                     "training task."
147                 )
148 
149 
150 class BulkDiscardProgressesForm(forms.Form):
151     """Form used to bulk discard all TrainingProgresses associated with
152     selected trainees."""
153 
154     trainees = forms.ModelMultipleChoiceField(queryset=Person.objects.all())
155 
156     helper = BootstrapHelper(
157         add_submit_button=False,
158         form_tag=False,
159         display_labels=False,
160         add_cancel_button=False,
161     )
162 
163     SUBMIT_POPOVER = """<p>Discarded progress will be displayed in the following
164     way: <span class='badge badge-dark'><strike>Discarded</strike></span>.</p>
165 
166     <p>If you want to permanently remove records from system,
167     click one of the progress labels and, then, click "delete" button.</p>"""
168 
169     helper.layout = Layout(
170         # no 'trainees' -- you should take care of generating it manually in
171         # the template where this form is used
172         # We use formnovalidate on submit button to disable browser
173         # validation. This is necessary because this form is used along with
174         # BulkAddTrainingProgressForm, which have required fields. Both forms
175         # live inside the same <form> tag. Without this attribute, when you
176         # click the following submit button, the browser reports missing
177         # values in required fields in BulkAddTrainingProgressForm.
178         Submit(
179             "discard",
180             "Discard all progress of selected trainees",
181             formnovalidate="formnovalidate",
182             **{
183                 "data-toggle": "popover",
184                 "data-trigger": "hover",
185                 "data-html": "true",
186                 "data-content": SUBMIT_POPOVER,
187                 "css_class": "btn btn-warning",
188             },
189         ),
190     )
191
```
--- 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/trainings/forms.py b/amy/trainings/forms.py
--- a/amy/trainings/forms.py
+++ b/amy/trainings/forms.py
@@ -24,6 +24,16 @@
         queryset=Person.objects.all(),
         widget=ModelSelect2Widget(data_view="admin-lookup"),
     )
+    requirement = forms.ModelChoiceField(
+        queryset=TrainingRequirement.objects.exclude(
+            Q(name__startswith="SWC")
+            | Q(name__startswith="DC")
+            | Q(name__startswith="LC")
+        ),
+        label="Type",
+        required=True,
+    )
+
     event = forms.ModelChoiceField(
         label="Event",
         required=False,

{"golden_diff": "diff --git a/amy/trainings/forms.py b/amy/trainings/forms.py\n--- a/amy/trainings/forms.py\n+++ b/amy/trainings/forms.py\n@@ -24,6 +24,16 @@\n         queryset=Person.objects.all(),\n         widget=ModelSelect2Widget(data_view=\"admin-lookup\"),\n     )\n+    requirement = forms.ModelChoiceField(\n+        queryset=TrainingRequirement.objects.exclude(\n+            Q(name__startswith=\"SWC\")\n+            | Q(name__startswith=\"DC\")\n+            | Q(name__startswith=\"LC\")\n+        ),\n+        label=\"Type\",\n+        required=True,\n+    )\n+\n     event = forms.ModelChoiceField(\n         label=\"Event\",\n         required=False,\n", "issue": "Hide lesson program specific checkout steps\nNow that we have a single Instructor badge, we do not want to see the lesson program specific checkout steps. These should be hidden from view so only four options remain.\r\n\r\n- ~DC Demo~\r\n- ~DC Homework~\r\n- Demo\r\n- Discussion\r\n- Homework\r\n- ~LC Demo~\r\n- ~LC Homework~\r\n- ~SWC Demo~\r\n- ~SWC Homework~\r\n- Training\n", "before_files": [{"content": "from crispy_forms.layout import Layout, Submit\nfrom django import forms\nfrom django.core.exceptions import ValidationError\nfrom django.db.models import Q\nfrom django.forms import RadioSelect, TextInput\n\n# this is used instead of Django Autocomplete Light widgets\n# see issue #1330: https://github.com/swcarpentry/amy/issues/1330\nfrom workshops.fields import ModelSelect2Widget\nfrom workshops.forms import SELECT2_SIDEBAR, BootstrapHelper\nfrom workshops.models import Event, Person, TrainingProgress, TrainingRequirement\n\n\nclass TrainingProgressForm(forms.ModelForm):\n    trainee = forms.ModelChoiceField(\n        label=\"Trainee\",\n        required=True,\n        queryset=Person.objects.all(),\n        widget=ModelSelect2Widget(data_view=\"person-lookup\"),\n    )\n    evaluated_by = forms.ModelChoiceField(\n        label=\"Evaluated by\",\n        required=False,\n        queryset=Person.objects.all(),\n        widget=ModelSelect2Widget(data_view=\"admin-lookup\"),\n    )\n    event = forms.ModelChoiceField(\n        label=\"Event\",\n        required=False,\n        queryset=Event.objects.all(),\n        widget=ModelSelect2Widget(data_view=\"event-lookup\", attrs=SELECT2_SIDEBAR),\n    )\n\n    # helper used in edit view\n    helper = BootstrapHelper(\n        duplicate_buttons_on_top=True,\n        submit_label=\"Update\",\n        add_delete_button=True,\n        additional_form_class=\"training-progress\",\n        add_cancel_button=False,\n    )\n\n    # helper used in create view\n    create_helper = BootstrapHelper(\n        duplicate_buttons_on_top=True,\n        submit_label=\"Add\",\n        additional_form_class=\"training-progress\",\n        add_cancel_button=False,\n    )\n\n    class Meta:\n        model = TrainingProgress\n        fields = [\n            \"trainee\",\n            \"evaluated_by\",\n            \"requirement\",\n            \"state\",\n            \"discarded\",\n            \"event\",\n            \"url\",\n            \"notes\",\n        ]\n        widgets = {\n            \"state\": RadioSelect,\n        }\n\n    def clean(self):\n        cleaned_data = super().clean()\n\n        trainee = cleaned_data.get(\"trainee\")\n\n        # check if trainee has at least one training task\n        training_tasks = trainee.get_training_tasks()\n\n        if not training_tasks:\n            raise ValidationError(\n                \"It's not possible to add training progress \"\n                \"to a trainee without any training task.\"\n            )\n\n\nclass BulkAddTrainingProgressForm(forms.ModelForm):\n    event = forms.ModelChoiceField(\n        label=\"Training\",\n        required=False,\n        queryset=Event.objects.filter(tags__name=\"TTT\"),\n        widget=ModelSelect2Widget(data_view=\"ttt-event-lookup\", attrs=SELECT2_SIDEBAR),\n    )\n\n    trainees = forms.ModelMultipleChoiceField(queryset=Person.objects.all())\n\n    requirement = forms.ModelChoiceField(\n        queryset=TrainingRequirement.objects.exclude(\n            Q(name__startswith=\"SWC\")\n            | Q(name__startswith=\"DC\")\n            | Q(name__startswith=\"LC\")\n        ),\n        label=\"Type\",\n        required=True,\n    )\n\n    helper = BootstrapHelper(\n        additional_form_class=\"training-progress\",\n        submit_label=\"Add\",\n        form_tag=False,\n        add_cancel_button=False,\n    )\n    helper.layout = Layout(\n        # no 'trainees' -- you should take care of generating it manually in\n        # the template where this form is used\n        \"requirement\",\n        \"state\",\n        \"event\",\n        \"url\",\n        \"notes\",\n    )\n\n    class Meta:\n        model = TrainingProgress\n        fields = [\n            # no 'trainees'\n            \"requirement\",\n            \"state\",\n            \"event\",\n            \"url\",\n            \"notes\",\n        ]\n        widgets = {\n            \"state\": RadioSelect,\n            \"notes\": TextInput,\n        }\n\n    def clean(self):\n        cleaned_data = super().clean()\n\n        trainees = cleaned_data.get(\"trainees\", [])\n\n        # check if all trainees have at least one training task\n        for trainee in trainees:\n            training_tasks = trainee.get_training_tasks()\n\n            if not training_tasks:\n                raise ValidationError(\n                    \"It's not possible to add training \"\n                    \"progress to a trainee without any \"\n                    \"training task.\"\n                )\n\n\nclass BulkDiscardProgressesForm(forms.Form):\n    \"\"\"Form used to bulk discard all TrainingProgresses associated with\n    selected trainees.\"\"\"\n\n    trainees = forms.ModelMultipleChoiceField(queryset=Person.objects.all())\n\n    helper = BootstrapHelper(\n        add_submit_button=False,\n        form_tag=False,\n        display_labels=False,\n        add_cancel_button=False,\n    )\n\n    SUBMIT_POPOVER = \"\"\"<p>Discarded progress will be displayed in the following\n    way: <span class='badge badge-dark'><strike>Discarded</strike></span>.</p>\n\n    <p>If you want to permanently remove records from system,\n    click one of the progress labels and, then, click \"delete\" button.</p>\"\"\"\n\n    helper.layout = Layout(\n        # no 'trainees' -- you should take care of generating it manually in\n        # the template where this form is used\n        # We use formnovalidate on submit button to disable browser\n        # validation. This is necessary because this form is used along with\n        # BulkAddTrainingProgressForm, which have required fields. Both forms\n        # live inside the same <form> tag. Without this attribute, when you\n        # click the following submit button, the browser reports missing\n        # values in required fields in BulkAddTrainingProgressForm.\n        Submit(\n            \"discard\",\n            \"Discard all progress of selected trainees\",\n            formnovalidate=\"formnovalidate\",\n            **{\n                \"data-toggle\": \"popover\",\n                \"data-trigger\": \"hover\",\n                \"data-html\": \"true\",\n                \"data-content\": SUBMIT_POPOVER,\n                \"css_class\": \"btn btn-warning\",\n            },\n        ),\n    )\n", "path": "amy/trainings/forms.py"}], "after_files": [{"content": "from crispy_forms.layout import Layout, Submit\nfrom django import forms\nfrom django.core.exceptions import ValidationError\nfrom django.db.models import Q\nfrom django.forms import RadioSelect, TextInput\n\n# this is used instead of Django Autocomplete Light widgets\n# see issue #1330: https://github.com/swcarpentry/amy/issues/1330\nfrom workshops.fields import ModelSelect2Widget\nfrom workshops.forms import SELECT2_SIDEBAR, BootstrapHelper\nfrom workshops.models import Event, Person, TrainingProgress, TrainingRequirement\n\n\nclass TrainingProgressForm(forms.ModelForm):\n    trainee = forms.ModelChoiceField(\n        label=\"Trainee\",\n        required=True,\n        queryset=Person.objects.all(),\n        widget=ModelSelect2Widget(data_view=\"person-lookup\"),\n    )\n    evaluated_by = forms.ModelChoiceField(\n        label=\"Evaluated by\",\n        required=False,\n        queryset=Person.objects.all(),\n        widget=ModelSelect2Widget(data_view=\"admin-lookup\"),\n    )\n    requirement = forms.ModelChoiceField(\n        queryset=TrainingRequirement.objects.exclude(\n            Q(name__startswith=\"SWC\")\n            | Q(name__startswith=\"DC\")\n            | Q(name__startswith=\"LC\")\n        ),\n        label=\"Type\",\n        required=True,\n    )\n\n    event = forms.ModelChoiceField(\n        label=\"Event\",\n        required=False,\n        queryset=Event.objects.all(),\n        widget=ModelSelect2Widget(data_view=\"event-lookup\", attrs=SELECT2_SIDEBAR),\n    )\n\n    # helper used in edit view\n    helper = BootstrapHelper(\n        duplicate_buttons_on_top=True,\n        submit_label=\"Update\",\n        add_delete_button=True,\n        additional_form_class=\"training-progress\",\n        add_cancel_button=False,\n    )\n\n    # helper used in create view\n    create_helper = BootstrapHelper(\n        duplicate_buttons_on_top=True,\n        submit_label=\"Add\",\n        additional_form_class=\"training-progress\",\n        add_cancel_button=False,\n    )\n\n    class Meta:\n        model = TrainingProgress\n        fields = [\n            \"trainee\",\n            \"evaluated_by\",\n            \"requirement\",\n            \"state\",\n            \"discarded\",\n            \"event\",\n            \"url\",\n            \"notes\",\n        ]\n        widgets = {\n            \"state\": RadioSelect,\n        }\n\n    def clean(self):\n        cleaned_data = super().clean()\n\n        trainee = cleaned_data.get(\"trainee\")\n\n        # check if trainee has at least one training task\n        training_tasks = trainee.get_training_tasks()\n\n        if not training_tasks:\n            raise ValidationError(\n                \"It's not possible to add training progress \"\n                \"to a trainee without any training task.\"\n            )\n\n\nclass BulkAddTrainingProgressForm(forms.ModelForm):\n    event = forms.ModelChoiceField(\n        label=\"Training\",\n        required=False,\n        queryset=Event.objects.filter(tags__name=\"TTT\"),\n        widget=ModelSelect2Widget(data_view=\"ttt-event-lookup\", attrs=SELECT2_SIDEBAR),\n    )\n\n    trainees = forms.ModelMultipleChoiceField(queryset=Person.objects.all())\n\n    requirement = forms.ModelChoiceField(\n        queryset=TrainingRequirement.objects.exclude(\n            Q(name__startswith=\"SWC\")\n            | Q(name__startswith=\"DC\")\n            | Q(name__startswith=\"LC\")\n        ),\n        label=\"Type\",\n        required=True,\n    )\n\n    helper = BootstrapHelper(\n        additional_form_class=\"training-progress\",\n        submit_label=\"Add\",\n        form_tag=False,\n        add_cancel_button=False,\n    )\n    helper.layout = Layout(\n        # no 'trainees' -- you should take care of generating it manually in\n        # the template where this form is used\n        \"requirement\",\n        \"state\",\n        \"event\",\n        \"url\",\n        \"notes\",\n    )\n\n    class Meta:\n        model = TrainingProgress\n        fields = [\n            # no 'trainees'\n            \"requirement\",\n            \"state\",\n            \"event\",\n            \"url\",\n            \"notes\",\n        ]\n        widgets = {\n            \"state\": RadioSelect,\n            \"notes\": TextInput,\n        }\n\n    def clean(self):\n        cleaned_data = super().clean()\n\n        trainees = cleaned_data.get(\"trainees\", [])\n\n        # check if all trainees have at least one training task\n        for trainee in trainees:\n            training_tasks = trainee.get_training_tasks()\n\n            if not training_tasks:\n                raise ValidationError(\n                    \"It's not possible to add training \"\n                    \"progress to a trainee without any \"\n                    \"training task.\"\n                )\n\n\nclass BulkDiscardProgressesForm(forms.Form):\n    \"\"\"Form used to bulk discard all TrainingProgresses associated with\n    selected trainees.\"\"\"\n\n    trainees = forms.ModelMultipleChoiceField(queryset=Person.objects.all())\n\n    helper = BootstrapHelper(\n        add_submit_button=False,\n        form_tag=False,\n        display_labels=False,\n        add_cancel_button=False,\n    )\n\n    SUBMIT_POPOVER = \"\"\"<p>Discarded progress will be displayed in the following\n    way: <span class='badge badge-dark'><strike>Discarded</strike></span>.</p>\n\n    <p>If you want to permanently remove records from system,\n    click one of the progress labels and, then, click \"delete\" button.</p>\"\"\"\n\n    helper.layout = Layout(\n        # no 'trainees' -- you should take care of generating it manually in\n        # the template where this form is used\n        # We use formnovalidate on submit button to disable browser\n        # validation. This is necessary because this form is used along with\n        # BulkAddTrainingProgressForm, which have required fields. Both forms\n        # live inside the same <form> tag. Without this attribute, when you\n        # click the following submit button, the browser reports missing\n        # values in required fields in BulkAddTrainingProgressForm.\n        Submit(\n            \"discard\",\n            \"Discard all progress of selected trainees\",\n            formnovalidate=\"formnovalidate\",\n            **{\n                \"data-toggle\": \"popover\",\n                \"data-trigger\": \"hover\",\n                \"data-html\": \"true\",\n                \"data-content\": SUBMIT_POPOVER,\n                \"css_class\": \"btn btn-warning\",\n            },\n        ),\n    )\n", "path": "amy/trainings/forms.py"}]}