Skip to content

Commit

Permalink
fix: Improve migration 0090 (use select_related instead)
Browse files Browse the repository at this point in the history
  • Loading branch information
faucomte97 committed Mar 1, 2024
1 parent aecb6d3 commit 3cf1dd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions game/migrations/0090_add_missing_model_solutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def add_missing_model_solutions(apps: Apps, *args):
],
score=10,
finish_time__gte=datetime.datetime(2023, 3, 1, 00, 00, tzinfo=pytz.UTC),
).prefetch_related("level")
).select_related("level")

LOGGER.info(f"Retrieved {attempts.count()} attempts.")

Expand Down Expand Up @@ -131,7 +131,7 @@ def remove_new_model_solutions(apps: Apps, *args):
],
score__gt=10,
finish_time__gte=datetime.datetime(2023, 3, 1, 00, 00, tzinfo=pytz.UTC),
).update(score=10)
).select_related("level").update(score=10)


class Migration(migrations.Migration):
Expand Down

0 comments on commit 3cf1dd2

Please sign in to comment.