Migrace přidávající skupiny org a resitel
This commit is contained in:
		
							parent
							
								
									aaef35aaea
								
							
						
					
					
						commit
						f15dcf2f41
					
				
					 1 changed files with 23 additions and 0 deletions
				
			
		
							
								
								
									
										23
									
								
								personalni/migrations/0001_skupiny.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								personalni/migrations/0001_skupiny.py
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,23 @@ | |||
| from django.db import migrations | ||||
| 
 | ||||
| 
 | ||||
| def add_groups(apps, schema_editor): | ||||
|     Group = apps.get_model('auth', 'Group') | ||||
| 
 | ||||
|     org_group = Group.objects.filter(name__exact='org').first() | ||||
|     if not org_group: | ||||
|         Group.objects.create(name='org') | ||||
|     resitel_group = Group.objects.filter(name__exact='resitel').first() | ||||
|     if not resitel_group: | ||||
|         Group.objects.create(name='resitel') | ||||
| 
 | ||||
| 
 | ||||
| class Migration(migrations.Migration): | ||||
| 
 | ||||
|     dependencies = [ | ||||
|         ('seminar', '0001_initial'), | ||||
|     ] | ||||
| 
 | ||||
|     operations = [ | ||||
|         migrations.RunPython(add_groups, migrations.RunPython.noop), | ||||
|     ] | ||||
		Loading…
	
		Reference in a new issue