diff --git a/pritunl_api/__init__.py b/pritunl_api/__init__.py index 2cbb6a4..9a84eb5 100644 --- a/pritunl_api/__init__.py +++ b/pritunl_api/__init__.py @@ -45,7 +45,7 @@ def get(self, org_id=None, usr_id=None): if org_id and usr_id: self.r = self.root.auth_request(method="GET", path="/key/{0}/{1}".format(org_id, usr_id)) if self.r.status_code == 200: - return self.r + return self.r.json() raise PritunlErr("{0}:{1}".format(sys._getframe().f_code.co_name, self.root.BASE_URL)) except Exception: raise PritunlErr("{0}:{1}".format(sys._getframe().f_code.co_name, self.root.BASE_URL)) diff --git a/pritunl_api/utils/keygen.py b/pritunl_api/utils/keygen.py index f8205c2..5015679 100644 --- a/pritunl_api/utils/keygen.py +++ b/pritunl_api/utils/keygen.py @@ -3,8 +3,8 @@ def profile_key(pritunl, org_id, usr_id): key = pritunl.key.get(org_id=org_id, usr_id=usr_id) if key: - key_uri_url = urlparse(pritunl.BASE_URL)._replace(scheme='pritunl').geturl() + key.json()['uri_url'] - key_view_url = pritunl.BASE_URL + key.json()['view_url'] + key_uri_url = urlparse(pritunl.BASE_URL)._replace(scheme='pritunl').geturl() + key['uri_url'] + key_view_url = pritunl.BASE_URL + key['view_url'] return key_uri_url, key_view_url else: return None, None