Skip to content

Commit

Permalink
Merge pull request #385 from City-of-Turku/fix/eco-counter-handle-err…
Browse files Browse the repository at this point in the history
…oneous-weeks-in-data-migration-0024

Fix/eco counter handle erroneous weeks in data migration 0024
  • Loading branch information
juuso-j authored Oct 3, 2024
2 parents 7f8ed82 + defdd96 commit 6a0bc4f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ def fix_models(apps, schema_editor):
for item in keep_weeks.items():
week = item[1]
year_numbers = item[0].split("_")[:-1]
# Handle erroneous weeks without a year.
if year_numbers == [""]:
continue
week.years.clear()
for year_number in year_numbers:
week.years.add(keep_years[year_number])
Expand Down

0 comments on commit 6a0bc4f

Please sign in to comment.