X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/83ad49633f3d16ccb7c0849cac04b1ebbde208ee..05f9254a542a08ea6476c6511bf2492192d0b92e:/apps/catalogue/models/book.py?ds=sidebyside diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index 626dd9cc..6aa183dc 100755 --- a/apps/catalogue/models/book.py +++ b/apps/catalogue/models/book.py @@ -365,10 +365,10 @@ class Book(models.Model): def refresh(self): """This should be done offline.""" - self.short_html - self.single - self.new_publishable - self.published + self.short_html() + self.single() + self.new_publishable() + self.published() # Materializing & publishing # ========================== @@ -479,6 +479,8 @@ class Book(models.Model): # print '.', w1t = i1.xslt(t) for h in w1t.findall('//aktywnosc/opis'): + if len(h) == 0: + raise ParseError('Pusty element aktywnosc/opis') # FIXME assumption that every lesson has at most 9 parts if not h[0].text or not re.match(r'\d\.\s', h[0].text): raise ParseError('Niepoprawny nagłówek (aktywnosc/opis): %s' % repr(h[0].text))