mirror of
				https://github.com/ae-utbm/sith.git
				synced 2025-11-04 02:53:06 +00:00 
			
		
		
		
	Merge pull request #982 from ae-utbm/groups
fix get_or_create in club group migration
This commit is contained in:
		@@ -34,10 +34,12 @@ def migrate_meta_groups(apps: StateApps, schema_editor):
 | 
			
		||||
    clubs = list(Club.objects.all())
 | 
			
		||||
    for club in clubs:
 | 
			
		||||
        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]
 | 
			
		||||
        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]
 | 
			
		||||
        club.save()
 | 
			
		||||
        club.refresh_from_db()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user