FAQ | This is a LIVE service | Changelog

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

Use first mapping if duplicated

parent 344f0884
Pipeline #193336 passed with stages
in 3 minutes and 15 seconds
......@@ -29,7 +29,13 @@ def fetch_inst_mapping(session: requests_oauthlib.OAuth2Session) -> Dict[str, st
continue
# Only interested in Student Records Institution ids
if id.scheme == IdentifierSchemes.STUDENT_INSTITUTION:
inst_map[id.value] = datum['instid']
# Warn if there is a duplicate mapping and keep first (typically College)
# rather than overwrite
if inst_map.get(id.value) is not None:
LOG.warning("Institution %s already mapped to %s not %s",
id.value, inst_map.get(id.value), datum['instid'])
else:
inst_map[id.value] = datum['instid']
LOG.info('Fetched mapping for %s institutions.', len(inst_map))
return inst_map
......@@ -17,7 +17,7 @@ def load_requirements():
setup(
name='lookupsync',
version='1.0.0',
version='1.0.1',
packages=find_packages(),
install_requires=load_requirements(),
entry_points={
......
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