From 849fac490de8d0078014a215109169ec6727b705 Mon Sep 17 00:00:00 2001 From: imperosol Date: Sat, 4 Jan 2025 18:49:00 +0100 Subject: [PATCH] fix get_or_create in club group migration --- club/migrations/0012_club_board_group_club_members_group.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/club/migrations/0012_club_board_group_club_members_group.py b/club/migrations/0012_club_board_group_club_members_group.py index ef907fca..f3d3a1e9 100644 --- a/club/migrations/0012_club_board_group_club_members_group.py +++ b/club/migrations/0012_club_board_group_club_members_group.py @@ -34,10 +34,12 @@ def migrate_meta_groups(apps: StateApps, schema_editor): clubs = list(Club.objects.all()) for club in clubs: club.board_group = meta_groups.get_or_create( - name=club.unix_name + settings.SITH_BOARD_SUFFIX + name=club.unix_name + settings.SITH_BOARD_SUFFIX, + defaults={"is_meta": True}, )[0] club.members_group = meta_groups.get_or_create( - name=club.unix_name + settings.SITH_MEMBER_SUFFIX + name=club.unix_name + settings.SITH_MEMBER_SUFFIX, + defaults={"is_meta": True}, )[0] club.save() club.refresh_from_db()