fixed authentication issue

This commit is contained in:
petergardfjall 2015-03-30 19:40:14 +02:00
parent 7bc48d41ed
commit d231be1aad

View File

@ -142,7 +142,11 @@ class GarminClient(object):
def _validate_auth_ticket(self, validation_url): def _validate_auth_ticket(self, validation_url):
log.debug("validating authentication ticket ...") log.debug("validating authentication ticket ...")
response = self.session.get(validation_url, allow_redirects=True) response = self.session.get(validation_url, allow_redirects=True)
if not response.status_code == 200: if response.status_code == 200 or response.status_code == 404:
# for some reason a 404 response code can also denote a
# successful auth ticket validation
return
raise Exception( raise Exception(
u"failed to validate authentication ticket: {}:\n{}".format( u"failed to validate authentication ticket: {}:\n{}".format(
response.status_code, response.text)) response.status_code, response.text))