Fix migrace
This commit is contained in:
		
							parent
							
								
									261f2447e3
								
							
						
					
					
						commit
						05047d547a
					
				
					 1 changed files with 8 additions and 5 deletions
				
			
		|  | @ -20,8 +20,10 @@ def prirad_deadliny(apps, schema_editor): | |||
|             if d is None: | ||||
|                 d = Deadline.objects.filter(cislo__rocnik=t.rocnik).last() | ||||
| 
 | ||||
|             h.deadline_body = d | ||||
|             h.save() | ||||
|             if d is not None: | ||||
|                 h.deadline_body = d | ||||
|                 h.save() | ||||
|                 continue | ||||
| 
 | ||||
|         except Exception: | ||||
|             pass | ||||
|  | @ -49,9 +51,10 @@ def prirad_deadliny(apps, schema_editor): | |||
|             d = Deadline.objects.filter(cislo=cislo, deadline__gte=h.reseni.cas_doruceni).first() | ||||
|             if d is None: | ||||
|                 d = Deadline.objects.filter(cislo=cislo).last() | ||||
|             h.deadline_body = d | ||||
|             h.save() | ||||
|             continue | ||||
|             if d is not None: | ||||
|                 h.deadline_body = d | ||||
|                 h.save() | ||||
|                 continue | ||||
| 
 | ||||
|         log.warning(f"Deadline hodnocení {h.id} se nepodařil určit exaktnějším způsobem. Zkouším další.") | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue