Míň spamu
This commit is contained in:
		
							parent
							
								
									40b10aa624
								
							
						
					
					
						commit
						e96e2ae353
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -25,7 +25,8 @@ def fix_ctypes(parent: str, children, apps, schema_editor): | ||||||
| 	# Ostatní instance mají mít explicitně content type pro rodiče | 	# Ostatní instance mají mít explicitně content type pro rodiče | ||||||
| 	new_ct = ContentType.objects.get_for_model(Parent) | 	new_ct = ContentType.objects.get_for_model(Parent) | ||||||
| 	for obj in Parent.objects.filter(polymorphic_ctype__isnull=True): | 	for obj in Parent.objects.filter(polymorphic_ctype__isnull=True): | ||||||
| 		log.warn(f"{parent} \"{obj}\" neměl content type -- nejspíš to je instance přímo {parent}!") | 		# Po úpravě pořadí migrací se tohle stane pro každý problém. Není to správně, ale warning moc otravuje… | ||||||
|  | 		log.info(f"{parent} \"{obj}\" neměl content type -- nejspíš to je instance přímo {parent}!") | ||||||
| 		obj.polymorphic_ctype=new_ct | 		obj.polymorphic_ctype=new_ct | ||||||
| 		obj.save() | 		obj.save() | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 MaM Web user
						MaM Web user