Skip to content

Commit 60a13d1

Browse files
committed
Minimize log messages
1 parent d84c2e7 commit 60a13d1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

caltechdata_api/decustomize_schema.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def decustomize_schema(json_record,pass_emails=False,pass_media=False):
2020

2121
#Extract identifier and label as DOI
2222
if "doi" in json_record:
23+
doi = json_record['doi']
2324
json_record['identifier'] = {'identifier':json_record['doi'],
2425
'identifierType':"DOI"}
2526
del json_record['doi']
@@ -77,7 +78,7 @@ def decustomize_schema(json_record,pass_emails=False,pass_media=False):
7778
idv.append(nid)
7879
new['nameIdentifiers']=idv
7980
else:
80-
print("Author identifiers not an array - please check")
81+
print("Author identifiers not an array - please check", doi)
8182
del a['authorIdentifiers']
8283
new['creatorName'] = a['authorName']
8384
newa.append(new)
@@ -105,7 +106,7 @@ def decustomize_schema(json_record,pass_emails=False,pass_media=False):
105106
newa.append(new)
106107
c['nameIdentifiers']=newa
107108
else:
108-
print("Contributor identifier not an array - please check")
109+
print("Contributor identifier not an array - please check",doi)
109110
del c['contributorIdentifiers']
110111
if pass_emails == False:
111112
if 'contributorEmail' in c:
@@ -146,7 +147,7 @@ def decustomize_schema(json_record,pass_emails=False,pass_media=False):
146147
del json_record['publicationDate']
147148

148149
else:
149-
print("No publication date set - something is odd with the record")
150+
print("No publication date set - something is odd with the record ",doi)
150151

151152
#license - no url available
152153
if 'rightsList' not in json_record:

0 commit comments

Comments
 (0)