Commit 0edece57 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update RecordPubli to fix bug in find_affiliation, ....

parent 8d5cd8a9
......@@ -178,12 +178,13 @@ class RecordPubli(Record):
keys = [key_u]
# affiliation can be list
# we assume the same length for the u and v field.
# length for the v field can be less than u one
# see for example inspirehep.net 1426414
else:
keys = key_u
if "v" in di:
keys_v = di["v"]
for i in xrange(len(keys)):
keys_v = (di["v"] if isinstance(di["v"], list) else [di["v"]])
for i in xrange(len(keys_v)):
keys[i] = "%s%s" % (keys[i], keys_v[i])
for affiliation in keys:
......@@ -265,8 +266,8 @@ class RecordPubli(Record):
keys = di['u']
if isinstance(keys, list):
if "v" in di:
keys_v = di["v"]
for i in xrange(len(keys)):
keys_v = (di["v"] if isinstance(di["v"], list) else [di["v"]])
for i in xrange(len(keys_v)):
keys[i] = "%s%s" % (keys[i], keys_v[i])
keys = u", ".join(keys)
......
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