Tokens: pass None password as ''

This commit is contained in:
2016-05-06 10:18:58 +02:00
parent 22825e31ad
commit 6c51cc7321

View File

@@ -60,7 +60,7 @@ class Api(object):
for retrieving the token.
"""
if token:
credentials = "%s:%s" % (token, self.password)
credentials = "%s:%s" % (token, self.password or '')
else:
credentials = "%s:%s" % (self.username, self.password)
return base64.b64encode(credentials.encode('utf-8')).decode('utf-8').replace("\n", "")