Skip to content

Commit

Permalink
Merge pull request #582 from rcpch/mbarton/fix-dashboard-crash
Browse files Browse the repository at this point in the history
Fix dashboard crash
  • Loading branch information
mbarton authored Feb 9, 2025
2 parents d602da1 + 53c3f68 commit 1194cf4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions project/npda/views/dashboard/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ def get_pt_demographic_value_counts(
"sex", "ethnicity", "index_of_multiple_deprivation_quintile"
)
sex_map = dict(SEX_TYPE)
sex_counts = Counter(sex_map[item["sex"]] for item in all_values)
sex_counts = Counter(sex_map.get(item["sex"]) for item in all_values)
ethnicity_map = dict(ETHNICITIES)
ethnicity_counts = Counter(ethnicity_map[item["ethnicity"]] for item in all_values)
ethnicity_counts = Counter(ethnicity_map.get(item["ethnicity"]) for item in all_values)
imd_map = {
1: "1st Quintile",
2: "2nd Quintile",
Expand Down Expand Up @@ -446,9 +446,9 @@ def get_pt_demographic_value_counts(
"sex", "ethnicity", "index_of_multiple_deprivation_quintile"
)
sex_map = dict(SEX_TYPE)
sex_counts = Counter(sex_map[item["sex"]] for item in all_values)
sex_counts = Counter(sex_map.get(item["sex"]) for item in all_values)
ethnicity_map = dict(ETHNICITIES)
ethnicity_counts = Counter(ethnicity_map[item["ethnicity"]] for item in all_values)
ethnicity_counts = Counter(ethnicity_map.get(item["ethnicity"]) for item in all_values)
imd_map = {
1: "1st Quintile",
2: "2nd Quintile",
Expand Down Expand Up @@ -722,9 +722,9 @@ def get_pt_demographic_value_counts(
"sex", "ethnicity", "index_of_multiple_deprivation_quintile"
)
sex_map = dict(SEX_TYPE)
sex_counts = Counter(sex_map[item["sex"]] for item in all_values)
sex_counts = Counter(sex_map.get(item["sex"]) for item in all_values)
ethnicity_map = dict(ETHNICITIES)
ethnicity_counts = Counter(ethnicity_map[item["ethnicity"]] for item in all_values)
ethnicity_counts = Counter(ethnicity_map.get(item["ethnicity"]) for item in all_values)
imd_map = {
1: "1st Quintile",
2: "2nd Quintile",
Expand Down

0 comments on commit 1194cf4

Please sign in to comment.