Commit 0d6ffbdd authored by Rob Carleski's avatar Rob Carleski 🇮🇸
Browse files

Add check to make sure result from group fetch is a group.

/profile/dn endpoint will work for uniqnames too, but return
a gross result.
parent f943f665
......@@ -212,7 +212,13 @@ class Client:
)
if r.status_code == requests.codes.ok:
self.group_data = r.json()['group'][0]
if 'umichgroup' in r.json()['group'][0]['objectClass']:
self.group_data = r.json()['group'][0]
else:
raise Exception('{} is not a group. Got [{}]'.format(
name,
', '.join(r.json()['group'][0]['objectClass'])
))
else:
raise Exception('{}: {}'.format(r.status_code, r.text))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment