Skip to content

Commit

Permalink
post-merge fix-up: latest.py: make sure references have ids
Browse files Browse the repository at this point in the history
  • Loading branch information
RayPlante committed Jul 25, 2022
1 parent a593c06 commit d3178df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/nistoar/nerdm/convert/latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ def convert(self, nerdmd, conv=[], version=None, byext=None, inplace=False):

if utils.cmp_versions(schver, "0.1") >= 0:
if 'references' in nerdmd:
for ref in nerdmd['references']:
for i, ref in enumerate(nerdmd['references']):
if 'refid' in ref:
if '@id' not in ref:
ref['@id'] = ref['refid']
del ref['refid']
if not ref.get('@id'):
ref['@id'] = "#ref-%d" % i

if utils.cmp_versions(schver, "0.6") >= 0:
if 'isPartOf' in nerdmd and not isinstance(nerdmd['isPartOf'], list):
Expand Down

0 comments on commit d3178df

Please sign in to comment.