From ae52d8991615c53986950505814090f7548f0795 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 13 May 2013 12:16:41 +0300 Subject: Use GSX_ENV in session cache key --- gsxws/core.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gsxws/core.py b/gsxws/core.py index b39771e..3154e55 100644 --- a/gsxws/core.py +++ b/gsxws/core.py @@ -394,6 +394,8 @@ class GsxSession(GsxObject): _namespace = "glob:" def __init__(self, user_id, password, sold_to, language, timezone): + global GSX_ENV + self.userId = user_id self.password = password self.languageCode = language @@ -401,7 +403,7 @@ class GsxSession(GsxObject): self.serviceAccountNo = str(sold_to) md5 = hashlib.md5() - md5.update(user_id + self.serviceAccountNo) + md5.update(user_id + self.serviceAccountNo + GSX_ENV) self._cache_key = md5.hexdigest() self._cache = GsxCache(self._cache_key) @@ -433,11 +435,11 @@ class GsxSession(GsxObject): def connect(user_id, password, sold_to, - environment='it', - language='en', + environment=GSX_ENV, + language=GSX_LANG, timezone='CEST', - region='emea', - locale='en_XXX'): + region=GSX_REGION, + locale=GSX_LOCALE): """ Establishes connection with GSX Web Services. Returns the session ID of the new connection. -- cgit v1.2.3