Skip to content

Commit

Permalink
Metadata: fix invalid license with restricted or closed data access r…
Browse files Browse the repository at this point in the history
…estriction
  • Loading branch information
lwesterhof committed Nov 29, 2023
1 parent 0af1b3b commit c4dad2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions schema_transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ def _default2_default3(ctx, m):
m['Related_Resource'] = resources
m.pop('Related_Datapackage')

# Restricted or closed data packages can't have open license.
data_access_restriction = m.get('Data_Access_Restriction', "")
if data_access_restriction == "Restricted - available upon request" or data_access_restriction == "Closed":
m['License'] = "Custom"

meta.metadata_set_schema_id(m, 'https://yoda.uu.nl/schemas/default-3/metadata.json')

return m
Expand Down

0 comments on commit c4dad2e

Please sign in to comment.