Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove question about learner count from WRF #2523

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion amy/autoemails/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def _setUpWorkshopRequest(self, create_event=False):
preferred_dates=None,
other_preferred_dates="soon",
language=Language.objects.get(name="English"),
number_attendees="10-40",
audience_description="Students of Hogwarts",
administrative_fee="nonprofit",
scholarship_circumstances="",
Expand Down
2 changes: 0 additions & 2 deletions amy/extforms/tests/test_workshop_inquiry_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def test_fields_presence(self):
"preferred_dates",
"other_preferred_dates",
"language",
"number_attendees",
"administrative_fee",
"travel_expences_management",
"travel_expences_management_other",
Expand Down Expand Up @@ -80,7 +79,6 @@ def test_request_added(self):
"preferred_dates": "",
"other_preferred_dates": "03-04 November, 2018",
"language": Language.objects.get(name="English").pk,
"number_attendees": "10-40",
"audience_description": "Students of Hogwarts",
"administrative_fee": "waiver",
"scholarship_circumstances": "Bugdet cuts in Ministry of Magic",
Expand Down
2 changes: 0 additions & 2 deletions amy/extforms/tests/test_workshop_request_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def test_fields_presence(self):
"preferred_dates",
"other_preferred_dates",
"language",
"number_attendees",
"audience_description",
"administrative_fee",
"scholarship_circumstances",
Expand Down Expand Up @@ -74,7 +73,6 @@ def test_request_added(self):
"preferred_dates": "",
"other_preferred_dates": "03-04 November, 2018",
"language": Language.objects.get(name="English").pk,
"number_attendees": "10-40",
"audience_description": "Students of Hogwarts",
"administrative_fee": "waiver",
"scholarship_circumstances": "Bugdet cuts in Ministry of Magic",
Expand Down
4 changes: 0 additions & 4 deletions amy/extrequests/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ class Meta:
"preferred_dates",
"other_preferred_dates",
"language",
"number_attendees",
"audience_description",
"administrative_fee",
"scholarship_circumstances",
Expand Down Expand Up @@ -335,7 +334,6 @@ class Meta:
"country": Select2Widget,
"online_inperson": forms.RadioSelect(),
"language": Select2Widget,
"number_attendees": forms.RadioSelect(),
"academic_levels": forms.CheckboxSelectMultiple(),
"computing_levels": forms.CheckboxSelectMultiple(),
"organization_type": forms.RadioSelect(),
Expand Down Expand Up @@ -717,7 +715,6 @@ class Meta:
"preferred_dates",
"other_preferred_dates",
"language",
"number_attendees",
"administrative_fee",
"travel_expences_management",
"travel_expences_management_other",
Expand All @@ -743,7 +740,6 @@ class Meta:
"country": Select2Widget,
"online_inperson": forms.RadioSelect(),
"language": Select2Widget,
"number_attendees": forms.RadioSelect(),
"computing_levels": forms.CheckboxSelectMultiple(),
"administrative_fee": forms.RadioSelect(),
"travel_expences_management": RadioSelectWithOther(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 3.2.20 on 2023-08-15 11:23

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('extrequests', '0030_auto_20211231_1108'),
]

operations = [
migrations.RemoveField(
model_name='workshopinquiryrequest',
name='number_attendees',
),
]
22 changes: 0 additions & 22 deletions amy/extrequests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,28 +225,6 @@ class WorkshopInquiryRequest(
" language, but cannot guarantee the availability of "
"non-English speaking Instructors.",
)
ATTENDEES_NUMBER_CHOICES = (
UNSURE_CHOICE,
("10-40", "10-40 (one room, two instructors)"),
("40-80", "40-80 (two rooms, four instructors)"),
("80-120", "80-120 (three rooms, six instructors)"),
)
number_attendees = models.CharField(
max_length=15,
choices=ATTENDEES_NUMBER_CHOICES,
blank=True,
null=True,
default=None,
verbose_name="Anticipated number of attendees",
help_text="These recommendations are for in-person workshops. "
"This number doesn't need to be precise, but will help us "
"decide how many instructors your workshop will need. "
"Each workshop must have at least two instructors.<br>"
"For online Carpentries workshops, we recommend a maximum of "
"20 learners per class. If your workshop attendance will "
"exceed 20 learners please be sure to include a note in the "
"comments section below. ",
)
FEE_CHOICES = (
(
"nonprofit",
Expand Down
4 changes: 0 additions & 4 deletions amy/extrequests/tests/test_workshop_inquiries.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ def setUp(self):
preferred_dates=None,
other_preferred_dates="soon",
language=Language.objects.get(name="English"),
number_attendees="10-40",
administrative_fee="nonprofit",
travel_expences_management="booked",
travel_expences_management_other="",
Expand All @@ -447,7 +446,6 @@ def setUp(self):
preferred_dates=None,
other_preferred_dates="soon",
language=Language.objects.get(name="English"),
number_attendees="40-80",
administrative_fee="forprofit",
travel_expences_management="reimbursed",
travel_expences_management_other="",
Expand Down Expand Up @@ -590,7 +588,6 @@ def setUp(self):
preferred_dates=None,
other_preferred_dates="soon",
language=Language.objects.get(name="English"),
number_attendees="10-40",
administrative_fee="nonprofit",
travel_expences_management="booked",
travel_expences_management_other="",
Expand Down Expand Up @@ -686,7 +683,6 @@ def setUp(self):
preferred_dates=None,
other_preferred_dates="soon",
language=Language.objects.get(name="English"),
number_attendees="10-40",
administrative_fee="nonprofit",
travel_expences_management="booked",
travel_expences_management_other="",
Expand Down
5 changes: 0 additions & 5 deletions amy/extrequests/tests/test_workshop_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def test_minimal_form(self):
"preferred_dates": "{:%Y-%m-%d}".format(date.today()),
"other_preferred_dates": "17-18 August, 2019",
"language": Language.objects.get(name="English").pk,
"number_attendees": "10-40",
"audience_description": "Students of Hogwarts",
"administrative_fee": "waiver",
"scholarship_circumstances": "Bugdet cuts in Ministry of Magic",
Expand Down Expand Up @@ -362,7 +361,6 @@ def setUp(self):
preferred_dates=None,
other_preferred_dates="soon",
language=Language.objects.get(name="English"),
number_attendees="10-40",
audience_description="Students of Hogwarts",
administrative_fee="nonprofit",
scholarship_circumstances="",
Expand All @@ -384,7 +382,6 @@ def setUp(self):
preferred_dates=None,
other_preferred_dates="soon",
language=Language.objects.get(name="English"),
number_attendees="40-80",
audience_description="Students of Hogwarts",
administrative_fee="forprofit",
scholarship_circumstances="",
Expand Down Expand Up @@ -521,7 +518,6 @@ def setUp(self):
preferred_dates=None,
other_preferred_dates="soon",
language=Language.objects.get(name="English"),
number_attendees="10-40",
audience_description="Students of Hogwarts",
administrative_fee="nonprofit",
scholarship_circumstances="",
Expand Down Expand Up @@ -613,7 +609,6 @@ def setUp(self):
preferred_dates=None,
other_preferred_dates="soon",
language=Language.objects.get(name="English"),
number_attendees="10-40",
audience_description="Students of Hogwarts",
administrative_fee="nonprofit",
scholarship_circumstances="",
Expand Down
2 changes: 0 additions & 2 deletions amy/extrequests/tests/test_wrfinitial.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def setUpOther(self):
location="Scotland",
preferred_dates=date(2020, 11, 11),
language=Language.objects.get(name="English"),
number_attendees="10-40",
administrative_fee="nonprofit",
additional_contact="test@example.org;test2@example.org",
online_inperson="online",
Expand All @@ -91,7 +90,6 @@ def setUpOther(self):
location="Scotland",
preferred_dates=date(2020, 11, 11),
language=Language.objects.get(name="English"),
number_attendees="10-40",
administrative_fee="nonprofit",
additional_contact="test@example.org;test2@example.org",
online_inperson="online",
Expand Down
1 change: 0 additions & 1 deletion amy/recruitment/tests/test_instructor_recruitment_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ def test_get_initial(self) -> None:
country="GB",
audience_description="Students of Hogwarts",
user_notes="Only Gryffindor allowed.",
number_attendees="10-40",
administrative_fee="nonprofit",
language=Language.objects.get(name="English"),
)
Expand Down
2 changes: 0 additions & 2 deletions amy/templates/includes/workshopinquiry_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@
{% endif %}
<tr><th>Preferred language for this workshop:</th>
<td>{{ object.language }}</td></tr>
<tr><th>Anticipated number of attendees:</th>
<td>{{ object.get_number_attendees_display }}</td></tr>
<tr><th>Administrative fee payment:</th>
<td>{{ object.get_administrative_fee_display }}</td></tr>
<tr><th>Travel expences management:</th>
Expand Down
2 changes: 0 additions & 2 deletions amy/templates/includes/workshoprequest_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
{% endif %}
<tr><th>Language the workshop will be conducted in:</th>
<td>{{ object.language }}</td></tr>
<tr><th>Anticipated number of attendees:</th>
<td>{{ object.get_number_attendees_display }}</td></tr>
<tr><th>Audience description:</th>
<td><pre>{{ object.audience_description }}</pre></td></tr>
<tr><th>Administrative fee payment:</th>
Expand Down
1 change: 0 additions & 1 deletion amy/templates/mailing/workshopinquiry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Requested workshop types: {% for type in object.requested_workshop_types.all %}{
Preferred date: {{ object.preferred_dates|date:'Y-m-d' }}
Other dates for the workshop: {{ object.other_preferred_dates }}
Preferred language for this workshop: {{ object.language }}
Anticipated number of attendees: {{ object.get_number_attendees_display }}
Administrative fee payment: {{ object.get_administrative_fee_display }}
Travel expences management: {{ object.get_travel_expences_management_display }} {% if object.travel_expences_management_other %}{{ object.travel_expences_management_other }}{% endif %}
Travel expences agreement: {{ object.travel_expences_agreement|yesno }}
Expand Down
1 change: 0 additions & 1 deletion amy/templates/mailing/workshopinquiry_admin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Preferred date: {{ object.preferred_dates|date:'Y-m-d' }}
Other dates for the workshop: {{ object.other_preferred_dates }}
"Dates too soon" warning shown: {{ object.preferred_dates_too_soon|yesno }}
Preferred language for this workshop: {{ object.language }}
Anticipated number of attendees: {{ object.get_number_attendees_display }}
Administrative fee payment: {{ object.get_administrative_fee_display }}
Travel expences management: {{ object.get_travel_expences_management_display }} {% if object.travel_expences_management_other %}{{ object.travel_expences_management_other }}{% endif %}
Travel expences agreement: {{ object.travel_expences_agreement|yesno }}
Expand Down
1 change: 0 additions & 1 deletion amy/templates/mailing/workshoprequest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Requested workshop types: {% for type in object.requested_workshop_types.all %}{
Preferred date: {{ object.preferred_dates|date:'Y-m-d' }}
Other dates for the workshop: {{ object.other_preferred_dates }}
Language the workshop will be conducted in: {{ object.language }}
Anticipated number of attendees: {{ object.get_number_attendees_display }}
Audience description: {{ object.audience_description|default:"---" }}
Administrative fee payment: {{ object.get_administrative_fee_display }}
Scholarship circumstances: {{ object.scholarship_circumstances|default:"---" }}
Expand Down
1 change: 0 additions & 1 deletion amy/templates/mailing/workshoprequest_admin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Preferred date: {{ object.preferred_dates|date:'Y-m-d' }}
Other dates for the workshop: {{ object.other_preferred_dates }}
"Dates too soon" warning shown: {{ object.preferred_dates_too_soon|yesno }}
Language the workshop will be conducted in: {{ object.language }}
Anticipated number of attendees: {{ object.get_number_attendees_display }}
Audience description: {{ object.audience_description|default:"---" }}
Administrative fee payment: {{ object.get_administrative_fee_display }}
Scholarship circumstances: {{ object.scholarship_circumstances|default:"---" }}
Expand Down
4 changes: 0 additions & 4 deletions amy/workshops/management/commands/fake_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,6 @@ def fake_workshop_requests(self, count=10):
).date(),
other_preferred_dates="Alternatively: soon",
language=language,
number_attendees=choice(WorkshopRequest.ATTENDEES_NUMBER_CHOICES)[0],
audience_description=self.faker.sentence(),
administrative_fee=administrative_fee,
scholarship_circumstances=scholarship_circumstances,
Expand Down Expand Up @@ -778,9 +777,6 @@ def fake_workshop_inquiries(self, count=10):
).date(),
other_preferred_dates="Alternatively: soon",
language=language,
number_attendees=choice(
WorkshopInquiryRequest.ATTENDEES_NUMBER_CHOICES
)[0],
administrative_fee=administrative_fee,
travel_expences_agreement=True,
travel_expences_management=travel_expences_management,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Generated by Django 3.2.20 on 2023-08-15 11:23

from django.db import migrations, models

ATTENDEES_NUMBER_CHOICES = (
("10-40", "10-40 (one room, two instructors)"),
("40-80", "40-80 (two rooms, four instructors)"),
("80-120", "80-120 (three rooms, six instructors)"),
)


class Migration(migrations.Migration):
dependencies = [
("workshops", "0262_alter_trainingrequest_training_completion_agreement"),
]

operations = [
migrations.AlterField(
model_name="workshoprequest",
name="number_attendees",
field=models.CharField(
max_length=15,
choices=ATTENDEES_NUMBER_CHOICES,
blank=False,
null=False,
default="", # must have a default for migration to be reversible
verbose_name="Anticipated number of attendees",
help_text="These recommendations are for in-person workshops. "
"This number doesn't need to be precise, but will help us "
"decide how many instructors your workshop will need. "
"Each workshop must have at least two instructors.<br>"
"For online Carpentries workshops, we recommend a maximum of "
"20 learners per class. If your workshop attendance will "
"exceed 20 learners please be sure to include a note in the "
"comments section below. ",
),
),
migrations.RemoveField(
model_name="workshoprequest",
name="number_attendees",
),
]
17 changes: 1 addition & 16 deletions amy/workshops/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3076,22 +3076,7 @@ class WorkshopRequest(
("40-80", "40-80 (two rooms, four instructors)"),
("80-120", "80-120 (three rooms, six instructors)"),
)
number_attendees = models.CharField(
max_length=15,
choices=ATTENDEES_NUMBER_CHOICES,
blank=False,
null=False,
default=None,
verbose_name="Anticipated number of attendees",
help_text="These recommendations are for in-person workshops. "
"This number doesn't need to be precise, but will help us "
"decide how many instructors your workshop will need. "
"Each workshop must have at least two instructors.<br>"
"For online Carpentries workshops, we recommend a maximum of "
"20 learners per class. If your workshop attendance will "
"exceed 20 learners please be sure to include a note in the "
"comments section below. ",
)

# MISSING
# This field is no longer needed, and should be hidden in the form and
# templates.
Expand Down
27 changes: 27 additions & 0 deletions amy/workshops/tests/test_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,30 @@ def test_workshops_0261_rollback(self):
self.assertIsNone(demo_progress.involvement_type)
self.assertIsNone(demo_progress.date)
self.assertEqual(demo_progress.notes, "")


class TestWorkshops0263Rollback(MigratorTestCase):
migrate_from = ("workshops", "0263_remove_workshoprequest_number_attendees")
migrate_to = (
"workshops",
"0262_alter_trainingrequest_training_completion_agreement",
)

def prepare(self):
"""Prepare some data before the migration."""
# create some requests
WorkshopRequest = self.old_state.apps.get_model("workshops", "WorkshopRequest")
Language = self.old_state.apps.get_model("workshops", "Language")
WorkshopRequest.objects.create(
location="London",
country="GB",
language=Language.objects.get(name="English"),
administrative_fee="nonprofit",
travel_expences_agreement=True,
)

def test_workshops_0263_rollback(self):
"""Ensure the migration can be rolled back without an error."""
WorkshopRequest = self.new_state.apps.get_model("workshops", "WorkshopRequest")
request = WorkshopRequest.objects.get(location="London")
self.assertEqual(request.number_attendees, "")
1 change: 0 additions & 1 deletion amy/workshops/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,6 @@ def setUp(self):
preferred_dates=None,
other_preferred_dates="soon",
language=Language.objects.get(name="English"),
number_attendees="10-40",
audience_description="Students of Hogwarts",
administrative_fee="waiver",
travel_expences_management="booked",
Expand Down
Loading