From 8a9304c72c5098216136683a0406762d4227510d Mon Sep 17 00:00:00 2001 From: "Bc. Petr Pecha" Date: Tue, 15 Sep 2015 23:06:17 +0200 Subject: [PATCH] Potlaceny vypis cisla a cisla nezadane ulohy Nezadane ulohy nemaji cislo ani poradove cislo --- seminar/models.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/seminar/models.py b/seminar/models.py index 019e2cca..c55eaa52 100644 --- a/seminar/models.py +++ b/seminar/models.py @@ -454,11 +454,12 @@ class Problem(SeminarModelBase): return force_unicode(u'%s' % (self.nazev, )) def kod_v_rocniku(self): - if self.typ == self.TYP_ULOHA: - return force_unicode(u"%s.u%s" % (self.cislo_zadani.cislo, self.kod,)) - if self.typ == self.TYP_TEMA: - return force_unicode(u"t%s" % (self.kod,)) - return '' + if self.stav == 'zadany': + if self.typ == self.TYP_ULOHA: + return force_unicode(u"%s.u%s" % (self.cislo_zadani.cislo, self.kod,)) + if self.typ == self.TYP_TEMA: + return force_unicode(u"t%s" % (self.kod,)) + return ' Není zadaný ' def nazev_typu(self): return dict(self.TYP_CHOICES)[self.typ]