FAQ | This is a LIVE service | Changelog

Commit b43ab7f3 authored by Robin Goodall's avatar Robin Goodall 💬
Browse files

Cleanup from review

parent ff6902b8
Pipeline #178903 passed with stages
in 3 minutes and 42 seconds
......@@ -2,7 +2,12 @@
Tool to query Lookup for CHRIS and CamSIS institutional membership.
> This tool is incomplete.
> This tool is currently only has the one operation `student-inst-members` that is able to compare
> CamSIS student affiliations to Lookup group membership and update as appropriate. It is not able
> to create Lookup groups.
>
> Additionally, an operation to do the same for CHRIS institution membership is yet to be
> implemented.
## Installation
......
......@@ -131,5 +131,3 @@ def _student_inst_members(opts: dict, dry_run: bool):
# Make changes to Lookup groups
update_lookup_groups(ibis_group_methods, group_changes, dry_run)
return '{ "status": "ok" }', {'Content-Type': 'application/json'}
......@@ -143,15 +143,10 @@ def fetch_all_students(
"""
next_url = urllib.parse.urljoin(STUDENT_API_ROOT, 'students')
first = True
while next_url is not None:
LOG.info('Fetching %s...', next_url)
r = session.get(next_url)
r.raise_for_status()
data = r.json()
for s in data.get('results', []):
if first:
first = False
LOG.info('%s', s)
yield Student.parse_obj(s)
yield from map(Student.parse_obj, data.get('results', []))
next_url = data.get('next')
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