replace MetaGroups by proper group management

This commit is contained in:
imperosol
2024-11-30 20:30:17 +01:00
parent cce7ecbe73
commit 6400b2c2c2
16 changed files with 410 additions and 355 deletions

View File

@ -118,18 +118,18 @@ class Command(BaseCommand):
self.make_important_citizen(u)
def make_clubs(self):
"""Create all the clubs (:class:`club.models.Club`).
"""Create all the clubs [club.models.Club][].
After creation, the clubs are stored in `self.clubs` for fast access later.
Don't create the meta groups (:class:`core.models.MetaGroup`)
nor the pages of the clubs (:class:`core.models.Page`).
Don't create the groups associated to the clubs
nor the pages of the clubs ([core.models.Page][]).
"""
self.clubs = []
for i in range(self.NB_CLUBS):
self.clubs.append(Club(unix_name=f"galaxy-club-{i}", name=f"club-{i}"))
# We don't need to create corresponding groups here, as the Galaxy doesn't care about them
Club.objects.bulk_create(self.clubs)
self.clubs = list(Club.objects.filter(unix_name__startswith="galaxy-").all())
self.clubs = Club.objects.bulk_create(
[
Club(unix_name=f"galaxy-club-{i}", name=f"club-{i}")
for i in range(self.NB_CLUBS)
]
)
def make_users(self):
"""Create all the users and store them in `self.users` for fast access later.