Skip to content

Commit

Permalink
minor fix for when absolute_url_path is '/' and the monthly summary l…
Browse files Browse the repository at this point in the history
…inks
  • Loading branch information
peterbe committed May 12, 2010
1 parent 9c1d970 commit 51a4f1d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions IssueTrackerProduct/Summary.py
Expand Up @@ -181,11 +181,18 @@ def getPrevNextMonthURLs(self, month=None, year=None):
prev_date = date - datetime.timedelta(days=1)
next_date = date + datetime.timedelta(days=31) # e.g. Jan 1 + 31 days is some time in Feb

prev_url = self.absolute_url_path() + prev_date.strftime('/%Y/%B')
if self.absolute_url_path() == '/':
prev_url = prev_date.strftime('/%Y/%B')
else:
prev_url = self.absolute_url_path() + prev_date.strftime('/%Y/%B')

if next_date > datetime.date.today():
next_url = None
else:
next_url = self.absolute_url_path() + next_date.strftime('/%Y/%B')
if self.absolute_url_path() == '/':
next_url = next_date.strftime('/%Y/%B')
else:
next_url = self.absolute_url_path() + next_date.strftime('/%Y/%B')
return prev_url, next_url


Expand Down

0 comments on commit 51a4f1d

Please sign in to comment.