File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,10 @@ def decustomize_schema(json_record):
5656 for a in authors :
5757 new = {}
5858 if 'authorAffiliation' in a :
59- new ['affiliations' ] = a ['authorAffiliation' ]
59+ if isinstance (c ['contributorAffiliation' ],list ):
60+ new ['affiliations' ] = a ['authorAffiliation' ]
61+ else :
62+ new ['affiliations' ] = [a ['authorAffiliation' ]]
6063 if 'authorIdentifiers' in a :
6164 idv = []
6265 for cid in a ['authorIdentifiers' ]:
@@ -77,7 +80,10 @@ def decustomize_schema(json_record):
7780 if "contributors" in json_record :
7881 for c in json_record ['contributors' ]:
7982 if 'contributorAffiliation' in c :
80- c ['affiliations' ] = c .pop ('contributorAffiliation' )
83+ if isinstance (c ['contributorAffiliation' ],list ):
84+ c ['affiliations' ] = c .pop ('contributorAffiliation' )
85+ else :
86+ c ['affiliations' ] = [c .pop ('contributorAffiliation' )]
8187 if 'contributorIdentifiers' in c :
8288 #if isinstance(c['contributorIdentifiers'],list):
8389 newa = []
You can’t perform that action at this time.
0 commit comments