fix generate_galaxy_test_data

This commit is contained in:
imperosol 2025-03-01 15:33:37 +01:00
parent 3d5cf98fb6
commit 9246c47774

View File

@ -127,14 +127,19 @@ class Command(BaseCommand):
# the galaxy doesn't care about the club groups, # the galaxy doesn't care about the club groups,
# but it's necessary to add them nonetheless in order # but it's necessary to add them nonetheless in order
# not to break the integrity constraints # not to break the integrity constraints
pages = Page.objects.bulk_create(
[Page(name="page", _full_name="page") for _ in range(self.NB_CLUBS)]
)
self.clubs = Club.objects.bulk_create( self.clubs = Club.objects.bulk_create(
[ [
Club( Club(
name=f"galaxy-club-{i}", name=f"galaxy-club-{i}",
slug_name=f"galaxy-club-{i}",
board_group=Group.objects.create(name=f"board {i}"), board_group=Group.objects.create(name=f"board {i}"),
members_group=Group.objects.create(name=f"members {i}"), members_group=Group.objects.create(name=f"members {i}"),
page=page,
) )
for i in range(self.NB_CLUBS) for i, page in enumerate(pages)
] ]
) )