Fix for token request

Now we simply request the token and not a dictionary with a key called
token.
This commit is contained in:
2015-04-08 14:27:25 +02:00
parent cbd5ee6e1a
commit 5e93946cf3

View File

@@ -65,7 +65,7 @@ class Api(object):
for retrieving the token.
"""
if token:
credentials = "{0}:0".format(token['token'])
credentials = "{0}:0".format(token)
else:
credentials = "%s:%s" % (self.username, self.password)
return base64.b64encode(credentials.encode('utf-8')).decode('utf-8').replace("\n", "")
@@ -77,7 +77,6 @@ class Api(object):
payload = {'username': self.username}
if self.token:
print("no tokens")
return self.token
else:
# If token is not set we do initial request with username and password