Odchyceni vyjimky u autocomplete
This commit is contained in:
		
							parent
							
								
									48b4b42ad3
								
							
						
					
					
						commit
						24d0639683
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		|  | @ -77,7 +77,12 @@ class ProblemAutocomplete(autocomplete_light.AutocompleteModelBase): | ||||||
| 
 | 
 | ||||||
|     def choice_label(self, p): |     def choice_label(self, p): | ||||||
|         if p.stav == Problem.STAV_ZADANY: |         if p.stav == Problem.STAV_ZADANY: | ||||||
|             return u"%s (%s, %s.%s)" % (p.nazev, p.typ, p.cislo_zadani.rocnik.rocnik, p.kod_v_rocniku()) |             popisek = "" | ||||||
|  |             try: | ||||||
|  |                 popisek = u"%s (%s, %s.%s)" % (p.nazev, p.typ, p.cislo_zadani.rocnik.rocnik, p.kod_v_rocniku()) | ||||||
|  |             except: | ||||||
|  |                 popisek = u"%s (%s, %s.%s)" % (p.nazev, p.typ, p.stav) | ||||||
|  |             return popisek | ||||||
|         else: |         else: | ||||||
|             return u"%s (%s, %s)" % (p.nazev, p.typ, p.stav) |             return u"%s (%s, %s)" % (p.nazev, p.typ, p.stav) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Bc. Petr Pecha
						Bc. Petr Pecha