From 5e93946cf35cd3820c2d7a3261a833f35ab33d1c Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Wed, 8 Apr 2015 14:27:25 +0200 Subject: [PATCH] Fix for token request Now we simply request the token and not a dictionary with a key called token. --- attractsdk/api.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/attractsdk/api.py b/attractsdk/api.py index 36cea0c..ee6238c 100644 --- a/attractsdk/api.py +++ b/attractsdk/api.py @@ -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