From 1194f383a79b0c61c69b38679ee277e445006e23 Mon Sep 17 00:00:00 2001 From: imperosol Date: Sun, 26 Oct 2025 16:45:24 +0100 Subject: [PATCH] add CGU/EULA to populate command --- core/management/commands/populate.py | 13 +++++++++++-- sith/settings.py | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/management/commands/populate.py b/core/management/commands/populate.py index cd0087e7..50111d93 100644 --- a/core/management/commands/populate.py +++ b/core/management/commands/populate.py @@ -28,6 +28,7 @@ from typing import ClassVar, NamedTuple from django.conf import settings from django.contrib.auth.models import Permission from django.contrib.sites.models import Site +from django.core.files.base import ContentFile from django.core.management import call_command from django.core.management.base import BaseCommand from django.db import connection @@ -104,13 +105,21 @@ class Command(BaseCommand): ) self.profiles_root = SithFile.objects.create(name="profiles", owner=root) home_root = SithFile.objects.create(name="users", owner=root) + club_root = SithFile.objects.create(name="clubs", owner=root) + sas = SithFile.objects.create(name="SAS", owner=root) + SithFile.objects.create( + name="CGU", + is_folder=False, + file=ContentFile( + content="Conditions générales d'utilisation", name="cgu.txt" + ), + owner=root, + ) # Page needed for club creation p = Page(name=settings.SITH_CLUB_ROOT_PAGE) p.save(force_lock=True) - club_root = SithFile.objects.create(name="clubs", owner=root) - sas = SithFile.objects.create(name="SAS", owner=root) main_club = Club.objects.create( id=1, name="AE", address="6 Boulevard Anatole France, 90000 Belfort" ) diff --git a/sith/settings.py b/sith/settings.py index 8647d8e9..7da3af0c 100644 --- a/sith/settings.py +++ b/sith/settings.py @@ -406,6 +406,8 @@ SITH_FORUM_PAGE_LENGTH = 30 SITH_SAS_ROOT_DIR_ID = env.int("SITH_SAS_ROOT_DIR_ID", default=4) SITH_SAS_IMAGES_PER_PAGE = 60 +SITH_CGU_FILE_ID = env.int("SITH_CGU_FILE_ID", default=5) + SITH_PROFILE_DEPARTMENTS = [ ("TC", _("TC")), ("IMSI", _("IMSI")),