18
									
								
								aircox/migrations/0022_set_group_ownership.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								aircox/migrations/0022_set_group_ownership.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					from django.db import migrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from aircox.models import Program
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def set_group_ownership(*args):
 | 
				
			||||||
 | 
					    for program in Program.objects.all():
 | 
				
			||||||
 | 
					        program.set_group_ownership()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Migration(migrations.Migration):
 | 
				
			||||||
 | 
					    dependencies = [
 | 
				
			||||||
 | 
					        ("aircox", "0021_alter_schedule_timezone"),
 | 
				
			||||||
 | 
					    ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    operations = [
 | 
				
			||||||
 | 
					        migrations.RunPython(set_group_ownership),
 | 
				
			||||||
 | 
					    ]
 | 
				
			||||||
		Reference in New Issue
	
	Block a user