Skip to content

Commit 26d6736

Browse files
committed
Fix error when cache is incomplete
1 parent 6d0fd64 commit 26d6736

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mkdocs_git_committers_plugin_2/plugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ def list_contributors(self, path):
7070
return [], last_commit_date
7171

7272
# Try to leverage the cache
73-
if self.cache_date and time.strptime(last_commit_date, "%Y-%m-%d") < time.strptime(self.cache_date, "%Y-%m-%d"):
74-
return self.cache_page_authors[path]['authors'], self.cache_page_authors[path]['last_commit_date']
73+
if path in self.cache_page_authors:
74+
if self.cache_date and time.strptime(last_commit_date, "%Y-%m-%d") < time.strptime(self.cache_date, "%Y-%m-%d"):
75+
return self.cache_page_authors[path]['authors'], self.cache_page_authors[path]['last_commit_date']
7576

7677
url_contribs = self.githuburl + self.config['repository'] + "/contributors-list/" + self.config['branch'] + "/" + path
7778
LOG.info("git-committers: fetching contributors for " + path)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name='mkdocs-git-committers-plugin-2',
6-
version='1.1.0',
6+
version='1.1.1',
77
description='An MkDocs plugin to create a list of contributors on the page',
88
long_description='The git-committers plugin will seed the template context with a list of github committers and other useful GIT info such as last modified date',
99
keywords='mkdocs pdf github',

0 commit comments

Comments
 (0)