Skip to content

Commit b6201c7

Browse files
author
Phil Rzewski
committed
Remove switch_user_team() method, as it never worked and can't work as described
1 parent 8afed5d commit b6201c7

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

sdcclient/_client.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -941,27 +941,6 @@ def remove_memberships(self, team, users):
941941
else:
942942
return [True, None]
943943

944-
def switch_user_team(self, new_team_id):
945-
'''**Description**
946-
Switches the current user context to the specified team. In other words, this function makes it possible to start operating in the context of a different team without having to use the token of that team.
947-
948-
**Arguments**
949-
- **new_team_id**: the numeric ID of the team (such as returned by :func:`~SdcClient.get_team_ids`) to switch to.
950-
'''
951-
res = self.get_user_info()
952-
if not res[0]:
953-
return res
954-
955-
myuinfo = res[1]['user']
956-
myuinfo['currentTeam'] = new_team_id
957-
uid = myuinfo['id']
958-
959-
res = requests.put(self.url + '/api/user/' + str(uid), headers=self.hdrs, data=json.dumps(myuinfo), verify=self.ssl_verify)
960-
if not self._checkResponse(res):
961-
return [False, self.lasterr]
962-
else:
963-
return [True, None]
964-
965944
def get_agents_config(self):
966945
res = requests.get(self.url + '/api/agents/config', headers=self.hdrs, verify=self.ssl_verify)
967946
if not self._checkResponse(res):

0 commit comments

Comments
 (0)