Skip to content

Commit

Permalink
import status to avoid surprises in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
why-not-try-calmer committed Jan 23, 2024
1 parent b793159 commit a5ddf9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions comptages/core/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ def _prepare_default_reports(
sections = models.Section.objects.filter(
lane__id_installation__count=count
).distinct()
assert sections

mondays_qty = len(list(_mondays_of_count(count)))
mondays = _mondays_of_count(count)
assert mondays

for section in sections:
for i, monday in enumerate(mondays):
progress = int(100 / mondays_qty * (i - 1))
Expand Down
5 changes: 5 additions & 0 deletions comptages/datamodel/management/commands/importdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Category,
Class,
ClassCategory,
CountDetail,
Device,
Installation,
Model,
Expand Down Expand Up @@ -438,3 +439,7 @@ def import_count(self):
import_file(str(file), count)

print(f"Imported {len(files)} count files!")
print(
"Setting all count details' status to 'definitive' to dodge a few surprises in tests..."
)
CountDetail.objects.update(import_status=0)

0 comments on commit a5ddf9a

Please sign in to comment.