Skip to content

Commit

Permalink
Merge pull request #71 from rkorzeniec/patch-1
Browse files Browse the repository at this point in the history
Fix KeyError: 'api_version' for self-hosted SCM
  • Loading branch information
ojacques authored Oct 3, 2024
2 parents 877d52c + da79a60 commit 39a2b29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mkdocs_git_committers_plugin_2/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ def on_config(self, config):
LOG.error("git-committers plugin: repository not specified")
return config
if self.config['enterprise_hostname'] and self.config['enterprise_hostname'] != '':
if not self.config['api_version']:
if not self.config.get('api_version'):
self.githuburl = "https://" + self.config['enterprise_hostname'] + "/api"
else:
self.githuburl = "https://" + self.config['enterprise_hostname'] + "/api/" + self.config['api_version']
if self.config['gitlab_hostname'] and self.config['gitlab_hostname'] != '':
if not self.config['api_version']:
if not self.config.get('api_version'):
self.gitlaburl = "https://" + self.config['gitlab_hostname'] + "/api/v4"
else:
self.gitlaburl = "https://" + self.config['gitlab_hostname'] + "/api/" + self.config['api_version']
Expand Down

0 comments on commit 39a2b29

Please sign in to comment.