Skip to content
Open
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
13 changes: 7 additions & 6 deletions lung_cancer_screening/questions/forms/gender_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ def __init__(self, *args, **kwargs):
choices=GenderValues.choices,
widget=forms.RadioSelect,
label="Which of these best describes you?",
label_classes="nhsuk-fieldset__legend--l",
label_is_page_heading=True,
hint=(
"This information is used to find your NHS number and "
"match with your GP record."
),
error_messages={
'required': 'Select the option that best describes your gender'
}
)

# Add divider before "None of the above"
fields = self["value"]
fields.add_divider_after(
Comment on lines +21 to +23
GenderValues.NON_BINARY,
"or"
)

class Meta:
model = GenderResponse
fields = ['value']
9 changes: 9 additions & 0 deletions lung_cancer_screening/questions/jinja2/gender.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% extends 'question_form.jinja' %}

{% block prelude %}
<h1 class="nhsuk-heading-l">Your gender identity</h1>

<p>The answers you submit will not be shared with your patient care advisor during your phone appointment, or with your GP.</p>

<p>In the future we plan to use information about someone's gender identity to help us plan their care in the NHS lung cancer screening programme.</p>
{% endblock prelude %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 6.0.3 on 2026-03-19 15:11

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('questions', '0007_termsofuseresponse'),
]

operations = [
migrations.AlterField(
model_name='genderresponse',
name='value',
field=models.CharField(choices=[('F', 'Female'), ('M', 'Male'), ('N', 'Non-binary'), ('P', 'Prefer not to say')], max_length=1),
),
Comment on lines +12 to +17
]
1 change: 0 additions & 1 deletion lung_cancer_screening/questions/models/gender_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class GenderValues(models.TextChoices):
MALE = "M", 'Male'
NON_BINARY = "N", 'Non-binary'
PREFER_NOT_TO_SAY = "P", 'Prefer not to say'
GP = "G", 'How I describe myself may not match my GP record'


class GenderResponse(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion lung_cancer_screening/questions/views/gender.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class GenderView(LoginRequiredMixin, EnsureResponseSet, EnsureEligibleMixin, QuestionBaseView):
template_name = "question_form.jinja"
template_name = "gender.jinja"
form_class = GenderForm
model = GenderResponse
success_url = reverse_lazy("questions:ethnicity")
Expand Down
Loading