Fix response is not defined (#233)
This commit is contained in:
parent
5368081b6b
commit
5efcbc2d2b
2 changed files with 3 additions and 3 deletions
|
@ -114,7 +114,7 @@ class PyiCloudSession(requests.Session):
|
||||||
def _raise_error(self, code, reason):
|
def _raise_error(self, code, reason):
|
||||||
if self.service.requires_2sa and \
|
if self.service.requires_2sa and \
|
||||||
reason == 'Missing X-APPLE-WEBAUTH-TOKEN cookie':
|
reason == 'Missing X-APPLE-WEBAUTH-TOKEN cookie':
|
||||||
raise PyiCloud2SARequiredError(response.url)
|
raise PyiCloud2SARequiredError(self.service.user['apple_id'])
|
||||||
if code == 'ZONE_NOT_FOUND' or code == 'AUTHENTICATION_FAILED':
|
if code == 'ZONE_NOT_FOUND' or code == 'AUTHENTICATION_FAILED':
|
||||||
reason = 'Please log into https://icloud.com/ to manually ' \
|
reason = 'Please log into https://icloud.com/ to manually ' \
|
||||||
'finish setting up your iCloud service'
|
'finish setting up your iCloud service'
|
||||||
|
|
|
@ -25,8 +25,8 @@ class PyiCloudFailedLoginException(PyiCloudException):
|
||||||
|
|
||||||
|
|
||||||
class PyiCloud2SARequiredError(PyiCloudException):
|
class PyiCloud2SARequiredError(PyiCloudException):
|
||||||
def __init__(self, url):
|
def __init__(self, apple_id):
|
||||||
message = "Two-step authentication required for %s" % url
|
message = "Two-step authentication required for account: %s" % apple_id
|
||||||
super(PyiCloud2SARequiredError, self).__init__(message)
|
super(PyiCloud2SARequiredError, self).__init__(message)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue