FAQ | This is a LIVE service | Changelog

Commit 76f04e2a authored by Dr Abraham Martin's avatar Dr Abraham Martin
Browse files

Merge branch 'hack-mapping-dups' into 'master'

Use first mapping if duplicated

See merge request !3
parents 344f0884 c8799644
Pipeline #193344 passed with stages
in 3 minutes and 8 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