Skip to content

Commit

Permalink
fix for missing year check in actions score import
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed Jul 9, 2024
1 parent 108dbb9 commit 73d0892
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scoring/management/commands/import_actions_scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def import_section_scores(self):
# update the section max_score as we go
section = PlanSection.objects.get(
description=row["section"],
year=self.YEAR,
)

try:
Expand Down Expand Up @@ -152,7 +153,7 @@ def import_overall_scores(self):

for desc in self.SECTIONS.values():
if not pd.isnull(row[desc]):
section = PlanSection.objects.get(description=desc)
section = PlanSection.objects.get(year=self.YEAR, description=desc)

section_score, created = PlanSectionScore.objects.get_or_create(
plan_section=section,
Expand All @@ -163,7 +164,7 @@ def import_overall_scores(self):
section_score.save()

def label_top_performers(self):
plan_sections = PlanSection.objects.filter(year=2023)
plan_sections = PlanSection.objects.filter(year=self.YEAR)

# reset top performers
PlanScore.objects.filter(year=2023).update(top_performer="")
Expand Down

0 comments on commit 73d0892

Please sign in to comment.