From f560468cae2f442d770b8bc41be97801ad357070 Mon Sep 17 00:00:00 2001 From: vermeul <swen@ethz.ch> Date: Wed, 14 Aug 2019 16:36:17 +0200 Subject: [PATCH] homeSpaceId param has been corrected to spaceId. --- pybis/src/python/pybis/person.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/pybis/src/python/pybis/person.py b/pybis/src/python/pybis/person.py index 6395fa27c42..a19d05d2e51 100644 --- a/pybis/src/python/pybis/person.py +++ b/pybis/src/python/pybis/person.py @@ -71,12 +71,12 @@ class Person(OpenBisObject): if space is None: query['space'] = '' else: - query['space'] = space.upper() + query['space'] = space.code.upper() if project is None: query['project'] = '' else: - query['project'] = project.upper() + query['project'] = project.code.upper() # build a query string for dataframe querystr = " & ".join( @@ -108,12 +108,6 @@ class Person(OpenBisObject): def save(self): if self.is_new: request = self._new_attrs() - # for new and updated objects, the parameter is - # unfortunately called homeSpaceId, spaceId throws no error - # but makes no change either - if "spaceId" in request['params'][1][0]: - request['params'][1][0]['homeSpaceId'] = request['params'][1][0]['spaceId'] - del(request['params'][1][0]['spaceId']) resp = self.openbis._post_request(self.openbis.as_v3, request) if VERBOSE: print("Person successfully created.") new_person_data = self.openbis.get_person(resp[0]['permId'], only_data=True) @@ -122,12 +116,6 @@ class Person(OpenBisObject): else: request = self._up_attrs() - # for new and updated objects, the parameter is - # unfortunately called homeSpaceId, spaceId throws no error - # but makes no change either - if "spaceId" in request['params'][1][0]: - request['params'][1][0]['homeSpaceId'] = request['params'][1][0]['spaceId'] - del(request['params'][1][0]['spaceId']) self.openbis._post_request(self.openbis.as_v3, request) if VERBOSE: print("Person successfully updated.") new_person_data = self.openbis.get_person(self.permId, only_data=True) -- GitLab