Fix a bug in all_posts generator (first post was not generated)
This commit is contained in:
parent
26fa4b91b9
commit
013dd1a62c
|
@ -81,7 +81,7 @@ class AllPosts(Index):
|
|||
cur_posts.append(p)
|
||||
|
||||
# Last month
|
||||
if not month_elem is None and len(cur_posts) != 0:
|
||||
if len(cur_posts) != 0:
|
||||
cur_posts.reverse()
|
||||
month_elem = self.createElement(dom, 'month')
|
||||
month_def = dom.createElement('month')
|
||||
|
@ -129,7 +129,7 @@ class AllPosts(Index):
|
|||
cur_posts.append(p)
|
||||
|
||||
# Last year
|
||||
if not year_elem is None and len(cur_posts) != 0:
|
||||
if len(cur_posts) != 0:
|
||||
year_elem = self.createElement(dom, 'year')
|
||||
year_def = dom.createElement('year')
|
||||
year_def.appendChild(dom.createTextNode(cur_posts[0].creation_date.strftime(date_format)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user