`user.get_service()` fails because response is already json
>>> e = ethz_iam_webservice.login(IAM_USERNAME, IAM_PASSWORD)
>>> user = e.get_user('beyerleu')
>>> gs = user.get_service("Mailbox")
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[15], line 1
----> 1 user.get_service("Mailbox")
File /usr/local/sysadm/iam/lib64/python3.11/site-packages/ethz_iam_webservice/user.py:152, in UserLegacy.get_service(self, service_name)
150 endpoint = "usermgr/user/{}/service/{}".format(self.username, service_name)
151 resp = self.get_request(endpoint)
--> 152 data = json.loads(resp.content.decode())
153 if resp.ok:
154 if service_name == "Mailbox":
AttributeError: 'dict' object has no attribute 'content'
Because a request.Response
is expected
but it's already converted to json:
There also only seems to be a UserLegacy
- so not sure how relevant this is.
(Note that the other data = json.loads(resp.content.decode())
on the page are ok because delete_request
returns a Response
. )