Skip to content

Commit

Permalink
Refactor and fix minor typo in sitemap code
Browse files Browse the repository at this point in the history
  • Loading branch information
talha131 committed Nov 9, 2013
1 parent 6ae722f commit 335c9c6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sitemap/sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ def write_url(self, page, fd):
else:
fd.write(self.siteurl + '/' + loc + '\n')

def get_date_modified(self, page, defalut):
def get_date_modified(self, page, default):
if hasattr(page, 'modified'):
if isinstance(getattr(page, 'modified'), datetime):
return getattr(page, 'modified')
return get_date(getattr(page, 'modified'))
if isinstance(page.modified, datetime):
return page.modified
return get_date(page.modified)
else:
return defalut
return default

def set_url_wrappers_modification_date(self, wrappers):
for (wrapper, articles) in wrappers:
Expand Down

0 comments on commit 335c9c6

Please sign in to comment.