fix error when there are no changes in an update
This commit is contained in:
parent
e17c14dbe6
commit
61f28ad4ac
1 changed files with 13 additions and 8 deletions
|
|
@ -264,14 +264,19 @@ class IssuePage(NewIssuePage):
|
|||
update['message'] = None
|
||||
|
||||
changes = []
|
||||
for li in self.parser.select(div, 'ul.details', 1).findall('li'):
|
||||
field = li.find('strong').text.decode('utf-8')
|
||||
if len(li.findall('i')) == 2:
|
||||
last = li.findall('i')[0].text.decode('utf-8')
|
||||
else:
|
||||
last = None
|
||||
new = li.findall('i')[-1].text.decode('utf-8')
|
||||
changes.append((field, last, new))
|
||||
try:
|
||||
details = self.parser.select(div, 'ul.details', 1)
|
||||
except BrokenPageError:
|
||||
pass
|
||||
else:
|
||||
for li in details.findall('li'):
|
||||
field = li.find('strong').text.decode('utf-8')
|
||||
if len(li.findall('i')) == 2:
|
||||
last = li.findall('i')[0].text.decode('utf-8')
|
||||
else:
|
||||
last = None
|
||||
new = li.findall('i')[-1].text.decode('utf-8')
|
||||
changes.append((field, last, new))
|
||||
update['changes'] = changes
|
||||
|
||||
params['updates'].append(update)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue