From 864fc8bfcf931662d18a05e50c55c2582030dc76 Mon Sep 17 00:00:00 2001 From: Laurent Date: Wed, 19 Feb 2025 11:04:22 +0100 Subject: [PATCH] fix custom migration --- tournaments/migrations/0109_special_store_id.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tournaments/migrations/0109_special_store_id.py b/tournaments/migrations/0109_special_store_id.py index 3ae3a27..321e416 100644 --- a/tournaments/migrations/0109_special_store_id.py +++ b/tournaments/migrations/0109_special_store_id.py @@ -37,10 +37,11 @@ def init_store_id(apps, schema_editor): if instance.team_registration: id = instance.team_registration.tournament.id else: - if instance.match.round: - id = instance.round.tournament.id + match = instance.match + if match.round: + id = match.round.tournament.id else: - id = instance.group_stage.tournament.id + id = match.group_stage.tournament.id instance.store_id = str(id) instance.save()