Skip to content

Commit 5ae9826

Browse files
committed
Fix for levels increasing count
1 parent d624de6 commit 5ae9826

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

lung_cancer_screening/questions/forms/types_tobacco_smoking_form.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def _create_types_selected(self):
9090

9191
def _create_default_responses_for_single_selection(self):
9292
response_set = self.response_set
93-
instances = response_set.tobacco_smoking_history
93+
instances = response_set.tobacco_smoking_history.normal()
9494
if instances.count() == 1:
9595
instance = instances.first()
9696

lung_cancer_screening/questions/views/smoking_frequency.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_success_url(self):
4646

4747
def get_back_link_url(self):
4848
if not self.kwargs.get("level") :
49-
if self.request.response_set.tobacco_smoking_history.count() == 1:
49+
if self.request.response_set.tobacco_smoking_history.normal().count() == 1:
5050
return reverse(
5151
"questions:types_tobacco_smoking",
5252
)

lung_cancer_screening/questions/views/types_tobacco_smoking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def get_success_url(self):
3636
tobacco_smoking_history.in_form_order().first()
3737
)
3838

39-
if (tobacco_smoking_history.count() == 1):
39+
if (tobacco_smoking_history.normal().count() == 1):
4040
return reverse("questions:smoking_frequency", kwargs={
4141
"tobacco_type": next_tobacco_smoking_history.url_type()
4242
})

0 commit comments

Comments
 (0)