Skip to content

Commit 5a03cb5

Browse files
committed
fix: tweaks to datacite conversion
1 parent 8589b9e commit 5a03cb5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

codemeticulous/datacite/convert.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,8 @@ def canonical_to_datacite(
352352
codemeta_actors_to_datacite(data.publisher, Publisher)
353353
),
354354
publicationYear=str(data.datePublished.year) if data.datePublished else None,
355-
subjects=[Subject(subject=subject) for subject in ensure_list(data.keywords)],
355+
subjects=[Subject(subject=subject) for subject in ensure_list(data.keywords)]
356+
or None,
356357
contributors=codemeta_actors_to_datacite(data.contributor, Contributor),
357358
dates=[
358359
DateModel(
@@ -374,7 +375,7 @@ def canonical_to_datacite(
374375
formats=codemeta_language_fileformat_to_datacite_format(
375376
data.programmingLanguage, data.fileFormat
376377
),
377-
version=str(data.version),
378+
version=str(data.version) if data.version else None,
378379
rightsList=codemeta_license_to_datacite_rights(data.license),
379380
descriptions=descriptions,
380381
# codemeta.funding is a plain string, can't really ensure that the string

0 commit comments

Comments
 (0)