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 ==
self.group_data = r.json()['group'][0]
if 'umichgroup' in r.json()['group'][0]['objectClass']:
self.group_data = r.json()['group'][0]
raise Exception('{} is not a group. Got [{}]'.format(
', '.join(r.json()['group'][0]['objectClass'])
raise Exception('{}: {}'.format(r.status_code, r.text))
Supports Markdown
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