Skip to content

Commit

Permalink
Merge branch 'canada-v2.9' into staging-v2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
JVickery-TBS committed Jul 25, 2023
2 parents 49a04fd + 211d50b commit 47ba3a8
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 55 deletions.
7 changes: 3 additions & 4 deletions ckanext/canada/i18n/en/LC_MESSAGES/ckanext-canada.po
Original file line number Diff line number Diff line change
Expand Up @@ -2289,6 +2289,9 @@ msgstr ""
msgid "Remember me"
msgstr "Keep me logged in"

msgid "Create Dataset"
msgstr "Create Record"

#~ msgid "\"page\" parameter must be a positive integer"
#~ msgstr ""

Expand Down Expand Up @@ -5123,10 +5126,6 @@ msgstr "Keep me logged in"

#~ msgid "View {organization_name}"
#~ msgstr ""

#~ msgid "Create Dataset"
#~ msgstr "Create Record"

#~ msgid ""
#~ " A CKAN Dataset is a collection"
#~ " of data resources (such as files),"
Expand Down
16 changes: 16 additions & 0 deletions ckanext/canada/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ class CanadaDatasetsPlugin(SchemingDatasetsPlugin):
"""
p.implements(p.IDatasetForm, inherit=True)
p.implements(p.IPackageController, inherit=True)
try:
from ckanext.validation.interfaces import IDataValidation
except ImportError:
log.warn('failed to import ckanext-validation interface')
else:
p.implements(IDataValidation, inherit=True)

#IDatasetForm
def prepare_dataset_blueprint(self, package_type, blueprint):
Expand Down Expand Up @@ -87,6 +93,16 @@ def prepare_resource_blueprint(self, package_type, blueprint):
)
return blueprint

# IDataValidation

def can_validate(self, context, resource):
"""
Only uploaded resources are allowed to be validated
"""
if resource.get(u'url_type') != u'upload':
return False
return True


# IPackageController
def before_search(self, search_params):
Expand Down
3 changes: 3 additions & 0 deletions ckanext/canada/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@
_("If the value XX (none) is entered here, then the following three fields must be identified as NA or N, "
"as applicable: Comprehensive Land Claim Agreement, Procurement Strategy for Aboriginal Business, "
"Procurement Strategy for Aboriginal Business Incidental Indicator")

# strings from core
_("Create Dataset")
Loading

0 comments on commit 47ba3a8

Please sign in to comment.