Skip to content
Snippets Groups Projects
Commit eb5236eb authored by anonymous's avatar anonymous
Browse files

ODPSH-27: validate spatial url in manuel upload

parent 3e723409
Branches
Tags
No related merge requests found
No preview for this file type
......@@ -154,6 +154,12 @@ msgstr "Dateien"
msgid "Spatial uri"
msgstr "Raumbezug"
msgid "Spatial uri: The specified URI is not known"
msgstr "Der räumliche Bezug is ungültig"
msgid "Spatial uri: Fehlender Wert"
msgstr "Bitte geben Sie einen räumlichen Bezug an"
msgid "Beginn des Zeitraumes: Fehlender Wert"
msgstr "Bitte wählen Sie einen Beginn des Zeitraumes aus"
......@@ -181,9 +187,6 @@ msgstr "Bitte geben Sie einen Titel ein"
msgid "odsh_publish_date_error_label"
msgstr "Bitte wählen Sie ein Veröffentlichungsdatum"
msgid "odsh_spatial_uri_error_label"
msgstr "Bitte geben sie einen räumlichen Bezug an"
msgid "Tag string: Fehlender Wert"
msgstr "Bitte wählen Sie geeignete Schlagwörter"
......
......@@ -71,7 +71,7 @@ def known_spatial_uri(key, data, errors, context):
try:
mapping_file = urllib2.urlopen(mapping_file)
except Exception:
raise toolkit.Invalid("Could not load spatial mapping file!")
raise Exception("Could not load spatial mapping file!")
not_found = True
spatial_text = str()
......@@ -86,7 +86,7 @@ def known_spatial_uri(key, data, errors, context):
print spatial
break
if not_found:
raise toolkit.Invalid("The specified URI is not known.")
raise toolkit.Invalid("The specified URI is not known")
# Get the current extras index
current_indexes = [k[1] for k in data.keys()
......
......@@ -157,7 +157,7 @@ is_required=true,placeholder=_('Enter title')) }}
{% endblock %}
<!-- field spatial_uri -->
{% set error_string = _('odsh_spatial_uri_error_label') if errors.spatial_uri %}
{% set error_string = _('Spatial uri' + ': '+errors.spatial_uri[0]) if errors.spatial_uri%}
{{ form.input('spatial_uri', id='field-spatial-uri', label=_('Spatial uri'),
value=data.spatial_uri,
error=error_string, classes=['control-full'],type='text',is_required=true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment