fix parsing changes when author doesn't have an account
This commit is contained in:
parent
4a29a246a2
commit
e17c14dbe6
2 changed files with 8 additions and 3 deletions
|
|
@ -55,7 +55,7 @@ class IssueFormatter(IFormatter):
|
|||
if item['history']:
|
||||
result += '\nHistory:\n'
|
||||
for u in item['history']:
|
||||
result += '* %s%s - %s%s\n' % (self.BOLD, u.date, u.author, self.NC)
|
||||
result += '* %s%s - %s%s\n' % (self.BOLD, u.date, u.author.name, self.NC)
|
||||
for change in u.changes:
|
||||
result += ' - %s%s%s: %s -> %s\n' % (self.BOLD, change.field, self.NC, change.last, change.new)
|
||||
if u.message:
|
||||
|
|
|
|||
|
|
@ -243,8 +243,13 @@ class IssuePage(NewIssuePage):
|
|||
update = {}
|
||||
update['id'] = div.find('h4').find('div').find('a').text[1:]
|
||||
alist = div.find('h4').findall('a')
|
||||
update['author'] = (int(alist[-2].attrib['href'].split('/')[-1]),
|
||||
to_unicode(alist[-2].text))
|
||||
if len(alist) == 3:
|
||||
update['author'] = (int(alist[-2].attrib['href'].split('/')[-1]),
|
||||
to_unicode(alist[-2].text))
|
||||
else:
|
||||
m = re.match('Updated by (.*)', alist[0].tail.strip())
|
||||
if m:
|
||||
update['author'] = (0, to_unicode(m.group(1)))
|
||||
update['date'] = self.parse_datetime(alist[-1].attrib['title'])
|
||||
if div.find('div') is not None:
|
||||
comment = div.find('div')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue