Skip to content

Commit

Permalink
[DDCI-115] Minor adjustments.
Browse files Browse the repository at this point in the history
  • Loading branch information
salsa-nathan committed Aug 26, 2020
1 parent 014a31a commit 2d8f743
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ckanext/qdes_schema/qdes_ckan_dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
},
{
"field_name": "temporal_start",
"label": "Start",
"label": "Temporal coverage start",
"display_property": "dcat:startDate",
"preset": "date",
"validators": "qdes_temporal_start_end_date",
Expand All @@ -100,7 +100,7 @@
},
{
"field_name": "temporal_end",
"label": "End",
"label": "Temporal coverage end",
"display_property": "dcat:endDate",
"preset": "date",
"validators": "qdes_temporal_start_end_date",
Expand Down
4 changes: 2 additions & 2 deletions ckanext/qdes_schema/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ def qdes_temporal_start_end_date(key, flattened_data, errors, context):
if (len(temporal_start_value) > 0) and (len(temporal_end_value) > 0):
if dt.strptime(temporal_start_value, '%Y-%m-%d') > dt.strptime(temporal_end_value, '%Y-%m-%d'):
if key == ('temporal_start',):
raise toolkit.Invalid("Start date must be less then end date.")
raise toolkit.Invalid("Must be earlier than end date.")
elif key == ('temporal_end',):
raise toolkit.Invalid("End date must be higher then start date.")
raise toolkit.Invalid("Must be later than start date.")

0 comments on commit 2d8f743

Please sign in to comment.