Skip to content

Commit

Permalink
GrouperAPI: params formatting #42
Browse files Browse the repository at this point in the history
PEP8 formatting #6
  • Loading branch information
astrochun committed Sep 15, 2020
1 parent 8e50cfd commit 03742fd
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions requiam/grouper_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ def get_group_list(self, group_type):
grouper_stem = figshare_stem(group_type, production=self.grouper_production)

params = dict()
params['WsRestFindGroupsRequest'] = {'wsQueryFilter':
{'queryFilterType': 'FIND_BY_STEM_NAME',
'stemName': grouper_stem}}
params['WsRestFindGroupsRequest'] = {
'wsQueryFilter':
{'queryFilterType': 'FIND_BY_STEM_NAME',
'stemName': grouper_stem}
}

rsp = requests.post(self.endpoint, auth=(self.grouper_user, self.grouper_password),
json=params, headers=self.headers)
rsp = requests.post(self.endpoint, json=params, headers=self.headers,
auth=(self.grouper_user, self.grouper_password))

return rsp.json()

Expand Down Expand Up @@ -88,8 +90,8 @@ def add_group(self, group, group_type, description):
}

try:
result = requests.post(endpoint, auth=(self.grouper_user, self.grouper_password),
json=params, headers=self.headers)
result = requests.post(endpoint, json=params, headers=self.headers,
auth=(self.grouper_user, self.grouper_password))

metadata = result.json()['WsGroupSaveResults']['resultMetadata']

Expand Down

0 comments on commit 03742fd

Please sign in to comment.