Skip to content

Commit

Permalink
Merge pull request #901 from python-gitlab/fix/non-auth
Browse files Browse the repository at this point in the history
fix: fix not working without auth
  • Loading branch information
max-wittig committed Oct 7, 2019
2 parents 35cc8c7 + 03b7b5b commit f4b2927
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions gitlab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from gitlab import utils # noqa

__title__ = "python-gitlab"
__version__ = "1.12.0"
__version__ = "1.12.1"
__author__ = "Gauvain Pocentek"
__email__ = "gauvainpocentek@gmail.com"
__license__ = "LGPL3"
Expand Down Expand Up @@ -350,13 +350,12 @@ def _construct_url(self, id_, obj, parameters, action=None):
return url

def _set_auth_info(self):
if (
sum(
bool(arg)
for arg in [self.private_token, self.oauth_token, self.job_token]
)
!= 1
):
tokens = [
token
for token in [self.private_token, self.oauth_token, self.job_token]
if token
]
if len(tokens) > 1:
raise ValueError(
"Only one of private_token, oauth_token or job_token should "
"be defined"
Expand Down

0 comments on commit f4b2927

Please sign in to comment.