Skip to content

Commit 3ac361f

Browse files
committed
Dropping Submitted date type handling
1 parent cb1ad87 commit 3ac361f

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

caltechdata_api/decustomize_schema.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,25 +131,21 @@ def decustomize_schema(json_record,pass_emails=False,pass_media=False):
131131

132132
#Set publicationYear and save publicationDate
133133
if 'publicationDate' in json_record:
134-
#If "Submitted' or 'Issued' date type was not manually set in metadata
134+
#If 'Issued' date type was not manually set in metadata
135135
#the system created publicationDate is correct
136-
if 'Issued' not in datetypes and 'Submitted' not in datetypes:
136+
if 'Issued' not in datetypes:
137137
if 'dates' in json_record:
138138
json_record['dates'].append({"date":json_record['publicationDate'],\
139-
"dateType": "Submitted"})
139+
"dateType": "Issued"})
140140
else:
141141
json_record['dates']=[{"date":json_record['publicationDate'],\
142-
"dateType": "Submitted"}]
142+
"dateType": "Issued"}]
143143
year = json_record['publicationDate'].split('-')[0]
144144
json_record['publicationYear'] = year
145-
#Otherwise pick 'Submitted' then 'Issued' date for publicationYear
145+
#Otherwise pick 'Issued' date for publicationYear
146146
else:
147-
if 'Submitted' in datetypes:
148-
selection = 'Submitted'
149-
else:
150-
selection = 'Issued'
151147
for d in json_record['dates']:
152-
if d['dateType'] == selection:
148+
if d['dateType'] == 'Issued':
153149
year = d['date'].split('-')[0]
154150
json_record['publicationYear'] = year
155151

0 commit comments

Comments
 (0)