Merge branch 'autocomplete' into Petr

This commit is contained in:
Bc. Petr Pecha 2015-09-23 22:23:56 +02:00
commit 7de84440fb

View file

@ -77,7 +77,12 @@ class ProblemAutocomplete(autocomplete_light.AutocompleteModelBase):
def choice_label(self, p):
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:
return u"%s (%s, %s)" % (p.nazev, p.typ, p.stav)