Skip to content
Browse files

Better error message formatting

  • Loading branch information...
1 parent 43a0e72 commit 996a380ef5fede5bfe91fcc2944d887d65dadc90 @elpaso elpaso committed Oct 6, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 qgis-app/plugins/forms.py
  2. +1 −1 qgis-app/plugins/validator.py
View
4 qgis-app/plugins/forms.py
@@ -59,8 +59,8 @@ def clean(self):
try:
self.cleaned_data.update(validator(package))
except ValidationError, e:
- msg = unicode(_("There were errors reading plugin package (please check also your plugin's metadata)."))
- raise ValidationError("%s %s" % (msg, ','.join(e.messages)))
+ msg = unicode(_("There were errors reading plugin package (please check also your plugin's metadata).<br />"))
+ raise ValidationError(mark_safe("%s %s" % (msg, '<br />'.join(e.messages))))
# Populate instance
self.instance.min_qg_version = self.cleaned_data.get('qgisMinimumVersion')
self.instance.version = PluginVersion.clean_version(self.cleaned_data.get('version'))
View
2 qgis-app/plugins/validator.py
@@ -60,7 +60,7 @@ def _check_required_metadata(metadata):
"""
for md in PLUGIN_REQUIRED_METADATA:
if not md in dict(metadata) or not dict(metadata)[md]:
- raise ValidationError(_('Cannot find metadata <strong>%s</strong> in metadata source (%s). Please bear in mind that the current implementation of the <tt>__init__.py</tt> validator is based on regular expressions, check that your metadata functions directly return metadata values as strings.<br/>For further informations about metadata parsing in this application, please see: <a target="_blank" href="https://github.com/qgis/qgis-django/blob/master/qgis-app/plugins/docs/metadata.rst">metadata documentation</a>') % (md, dict(metadata).get('metadata_source')))
+ raise ValidationError(_('Cannot find metadata <strong>%s</strong> in metadata source (%s).<br />Please bear in mind that the current implementation of the <tt>__init__.py</tt> validator is based on regular expressions, check that your metadata functions directly return metadata values as strings.<br />For further informations about metadata parsing in this application, please see: <a target="_blank" href="https://github.com/qgis/qgis-django/blob/master/qgis-app/plugins/docs/metadata.rst">metadata documentation</a>') % (md, dict(metadata).get('metadata_source')))
def validator(package):

0 comments on commit 996a380

Please sign in to comment.
Something went wrong with that request. Please try again.