fnp
/
redakcja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
863fcf1
)
don't assume that aktywnosc/opis is non-empty
author
Jan Szejko
<jan.szejko@gmail.com>
Thu, 23 Jun 2016 10:02:09 +0000
(12:02 +0200)
committer
Jan Szejko
<jan.szejko@gmail.com>
Thu, 23 Jun 2016 10:02:09 +0000
(12:02 +0200)
apps/catalogue/models/book.py
patch
|
blob
|
history
diff --git
a/apps/catalogue/models/book.py
b/apps/catalogue/models/book.py
index
626dd9c
..
09164a3
100755
(executable)
--- a/
apps/catalogue/models/book.py
+++ b/
apps/catalogue/models/book.py
@@
-479,6
+479,8
@@
class Book(models.Model):
# print '.',
w1t = i1.xslt(t)
for h in w1t.findall('//aktywnosc/opis'):
# 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))
# 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))