Commit 8cf19e60 authored by Loic Baron's avatar Loic Baron
Browse files

TODO: handle SfaReg without sub-authorities

parent 1dac8f03
......@@ -76,10 +76,12 @@ class SfaReg(SfaApi):
filtered_entites = []
for record in result:
# TODO: handle no sub-authorities
if entity == 'project':
if record['type'] == 'authority' and len(record['hrn'].split('.'))>2:
filtered_entites.append(record)
# TODO: handle no sub-authorities
elif entity == 'authority':
if len(record['hrn'].split('.')) <3:
filtered_entites.append(record)
......@@ -181,6 +183,7 @@ class SfaReg(SfaApi):
for d in data:
if d.get('classtype')=='authority':
a = d.get('hrn')
# TODO: handle no sub-authorities
if a is None or len(a.split('.')) < 3:
if d.get('hrn') in l_authorities.keys():
l_authorities[d.get('hrn')].update(d)
......@@ -243,6 +246,7 @@ class SfaReg(SfaApi):
o = d.get('hrn')
a = d.get('authority')
if d.get('classtype')=='authority':
# TODO: handle no sub-authorities
if o is not None and len(o.split('.')) > 2:
if d.get('hrn') in l_projects.keys():
l_projects[d.get('hrn')].update(d)
......
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