aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-05-23 22:44:37 +0200
committerEgor Tensin <egor@tensin.name>2026-05-23 22:46:09 +0200
commit6167ac4e834a25e14867aafd419bd9b644bfa6e4 (patch)
tree46deabad6075db1a121f6187827f28ec297b7e46
parenttest/unit: add checks for visibility (diff)
downloadcgitize-6167ac4e834a25e14867aafd419bd9b644bfa6e4.tar.gz
cgitize-6167ac4e834a25e14867aafd419bd9b644bfa6e4.zip
github: fix parameter passingv7.0.0
Diffstat (limited to '')
-rw-r--r--cgitize/github.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/cgitize/github.py b/cgitize/github.py
index 666451f..b03e085 100644
--- a/cgitize/github.py
+++ b/cgitize/github.py
@@ -27,15 +27,22 @@ class GitHub:
def get_user_repos(self, user, visibility=Visibility.ALL):
visibility = visibility.to_github_arg()
+
+ # Not actually certain how it works, but just passing None as the
+ # named visibility parameter fails with an internal assert error. I
+ # honestly thought that that passing parameters like that and as a
+ # None makes no difference.
+ kwargs = {}
+ if visibility is not None:
+ kwargs['visibility'] = visibility
+
try:
if user.name == self._username:
# To get private repositories, get_user() must be called
# without arguments:
- return self._impl.get_user().get_repos(
- affiliation='owner', visibility=visibility
- )
+ return self._impl.get_user().get_repos(affiliation='owner', **kwargs)
else:
- return self._impl.get_user(user.name).get_repos(visibility=visibility)
+ return self._impl.get_user(user.name).get_repos(**kwargs)
except GithubException:
logging.error("Couldn't fetch user repositories: %s", user.name)
raise