Open dalefrancum opened 7 years ago
I don't have rights to push a branch. Here is a diff for my code changes:
--- a/salesforce/login.py
+++ b/salesforce/login.py
@@ -3,6 +3,7 @@ from exception import AuthenticationFailed
import urllib
import utils
import xml.dom.minidom
+import re
class Authentication(object):
@@ -165,7 +166,10 @@ class LoginWithSoapAPI(Login):
headers,
data=data)
- xml_value = xml.dom.minidom.parseString(response.text)
+ # Remove currency symbol from XML response
+ response_text = re.sub('<currencySymbol>.*</currencySymbol>', '', response.text)
+
+ xml_value = xml.dom.minidom.parseString(response_text)
access_token = utils.get_element_by_name(xml_value, 'sessionId')
url = urlparse(utils.get_element_by_name(xml_value, 'serverUrl'))
instance_url = '{0}://{1}'.format(url.scheme, url.netloc)
I forked the repo and created a pull request from my branch into this master: #9
While using British pounds for currency, during the SOAP API call to authenticate, a response is returned from Salesforce which contains this line:
The login.py code tried to parse the response with this line:
The following error occurred:
I have a proposed fix for this, which is to remove the node from the XML response string. I will post the patch shortly.