Commit fdb57129 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Add protection against list of first author (inspirehep 1385293).

parent 7f583950
......@@ -162,7 +162,11 @@ def edit_insert():
except CheckException:
pass
values['PublicationsFirst_author'] = record.first_author()
fauthor = record.first_author()
if isinstance(fauthor, list):
fauthor = u", ".join(fauthor)
values['PublicationsFirst_author'] = fauthor
values['PublicationsAuthors'] = record.authors()
values['PublicationsAuthors_institute'] = record.my_authors
......
......@@ -107,12 +107,22 @@ class RecordPubli(Record):
break
# the first author is defined not the other one
elif first_author and isinstance(first_author, list):
authors.extend(first_author)
elif first_author:
authors.append(first_author)
authors.append(first_author)
# sometime the first author is missing
if first_author and len(authors) > 0 and first_author != authors[0]:
authors.insert(0, first_author)
if first_author and len(authors) > 0:
if isinstance(first_author, list):
for i in xrange(len(first_author)):
if first_author[i] != authors[i]:
authors.insert(i, first_author[i])
elif first_author != authors[0]:
authors.insert(0, first_author)
return authors
......
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