Update RGA validator (#3134)

This commit is contained in:
Leon Friedrich
2022-08-15 09:17:36 +12:00
committed by GitHub
parent cf9250f25d
commit c56cc24804

View File

@@ -4,6 +4,8 @@ import validators
class License(Validator):
tag = "license"
licenses = [
"CC-BY-3.0",
"CC-BY-4.0",
"CC-BY-SA-3.0",
"CC-BY-SA-4.0",
"CC-BY-NC-3.0",
@@ -11,7 +13,8 @@ class License(Validator):
"CC-BY-NC-SA-3.0",
"CC-BY-NC-SA-4.0",
"CC0-1.0",
"MIT"
"MIT",
"Custom" # implies that the license is described in the copyright field.
]
def _is_valid(self, value):
@@ -21,4 +24,5 @@ class Url(Validator):
tag = "url"
def _is_valid(self, value):
return validators.url(value)
# Source field is required to ensure its not neglected, but there may be no applicable URL
return (value == "NA") or validators.url(value)