fix parsing issue history on redmine 2.4
This commit is contained in:
parent
ce4c9f7d84
commit
343062771d
1 changed files with 10 additions and 9 deletions
|
|
@ -448,16 +448,17 @@ class IssuePage(NewIssuePage):
|
||||||
params['updates'] = []
|
params['updates'] = []
|
||||||
for div in self.parser.select(content, 'div.journal'):
|
for div in self.parser.select(content, 'div.journal'):
|
||||||
update = {}
|
update = {}
|
||||||
alist = div.find('h4').xpath('.//a')
|
update['id'] = div.xpath('.//h4//a')[0].text[1:]
|
||||||
update['id'] = alist[0].text[1:]
|
user_link = div.xpath('.//h4//a[contains(@href, "/users/")]')
|
||||||
if len(alist) == 4:
|
if len(user_link) > 0:
|
||||||
update['author'] = (int(alist[-2].attrib['href'].split('/')[-1]),
|
update['author'] = (int(user_link[0].attrib['href'].split('/')[-1]),
|
||||||
to_unicode(alist[-2].text))
|
to_unicode(user_link[0].text))
|
||||||
else:
|
else:
|
||||||
m = re.match('Updated by (.*)', alist[0].tail.strip())
|
for txt in div.xpath('.//h4//text()'):
|
||||||
if m:
|
m = re.search('Updated by (.*)', txt.strip())
|
||||||
update['author'] = (0, to_unicode(m.group(1)))
|
if m:
|
||||||
update['date'] = self.parse_datetime(alist[-1].attrib['title'])
|
update['author'] = (0, to_unicode(m.group(1)))
|
||||||
|
update['date'] = self.parse_datetime(div.xpath('.//h4//a[last()]')[0].attrib['title'])
|
||||||
if div.find('div') is not None:
|
if div.find('div') is not None:
|
||||||
comment = div.find('div')
|
comment = div.find('div')
|
||||||
subdiv = comment.find('div')
|
subdiv = comment.find('div')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue