mirror of
				https://github.com/ae-utbm/sith.git
				synced 2025-11-04 02:53:06 +00:00 
			
		
		
		
	add CGU/EULA to populate command
This commit is contained in:
		@@ -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"
 | 
			
		||||
        )
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user