- if meta.thema_main or meta.thema:
- if meta.thema_main:
- comment = "w kategorii <b><tt>{code}</tt></b>".format(
- code=escape(meta.thema_main)
- )
- if meta.thema:
- comment += " oraz: " + ", ".join(
- "<b><tt>{code}</tt></b>".format(code=escape(t))
- for t in meta.thema
- )
- d['comment'] = mark_safe(comment)
- elif meta.thema:
- d['comment'] = mark_safe(
- "w kategorii " + ", ".join(
- "<b><tt>{code}</tt></b>".format(code=escape(t))
- for t in meta.thema
- )
+ try:
+ meta = book.wldocument(librarian2=True).meta
+ except:
+ d['errors'].append('Nieprawidłowy dokument.')
+ return d
+ thema = self.get_thema(meta)
+ if thema:
+ d['info'].append(mark_safe(
+ "w kategorii " + ", ".join(
+ "<b><tt>{code}</tt></b>".format(code=escape(t))
+ for t in thema