mirror of
https://github.com/ae-utbm/sith.git
synced 2025-01-07 23:51:14 +00:00
fix get_or_create in club group migration
This commit is contained in:
parent
6eb860579a
commit
849fac490d
@ -34,10 +34,12 @@ def migrate_meta_groups(apps: StateApps, schema_editor):
|
|||||||
clubs = list(Club.objects.all())
|
clubs = list(Club.objects.all())
|
||||||
for club in clubs:
|
for club in clubs:
|
||||||
club.board_group = meta_groups.get_or_create(
|
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]
|
)[0]
|
||||||
club.members_group = meta_groups.get_or_create(
|
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]
|
)[0]
|
||||||
club.save()
|
club.save()
|
||||||
club.refresh_from_db()
|
club.refresh_from_db()
|
||||||
|
Loading…
Reference in New Issue
Block a user