Skip to content

Commit 5efcbc2

Browse files
authored
Fix response is not defined (#233)
1 parent 5368081 commit 5efcbc2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pyicloud/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def request(self, *args, **kwargs):
114114
def _raise_error(self, code, reason):
115115
if self.service.requires_2sa and \
116116
reason == 'Missing X-APPLE-WEBAUTH-TOKEN cookie':
117-
raise PyiCloud2SARequiredError(response.url)
117+
raise PyiCloud2SARequiredError(self.service.user['apple_id'])
118118
if code == 'ZONE_NOT_FOUND' or code == 'AUTHENTICATION_FAILED':
119119
reason = 'Please log into https://icloud.com/ to manually ' \
120120
'finish setting up your iCloud service'

pyicloud/exceptions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class PyiCloudFailedLoginException(PyiCloudException):
2525

2626

2727
class PyiCloud2SARequiredError(PyiCloudException):
28-
def __init__(self, url):
29-
message = "Two-step authentication required for %s" % url
28+
def __init__(self, apple_id):
29+
message = "Two-step authentication required for account: %s" % apple_id
3030
super(PyiCloud2SARequiredError, self).__init__(message)
3131

3232

0 commit comments

Comments
 (0)