File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -294,13 +294,17 @@ def codemeta_license_to_datacite_rights(
294294 # plain string licenses should always be urls
295295 if isinstance (l , str ) and is_url (l ):
296296 license_url = l
297- elif hasattr (l , "url" ) and is_url (l .url ):
298- license_url = l .url
299- elif hasattr (l , "name" ):
300- license_name = l .name
297+ else :
298+ if hasattr (l , "url" ) and is_url (l .url ):
299+ license_url = l .url
300+ if hasattr (l , "name" ):
301+ license_name = l .name
301302 # FIXME: build a lookup table for spdx/osi licenses so we can figure out
302303 # what license is being used and fill out all fields
303- rights_list .append (RightsListItem (rights = license_name , rightsUri = license_url ))
304+ if license_name or license_url :
305+ rights_list .append (
306+ RightsListItem (rights = license_name , rightsUri = license_url )
307+ )
304308 return rights_list or None
305309
306310
You can’t perform that action at this time.
0 commit comments