mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Update RGA validator (#3134)
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user