Part of lp.app.validators View In Hierarchy
Known subclasses: lp.bugs.errors.InvalidDuplicateValue, lp.registry.interfaces.product.InvalidProductName, lp.services.identity.interfaces.account.AccountStatusError
A LaunchpadValidationError may be raised from a schema field validation method.
It is used return a meaningful error message to the user. The message may contain XHTML markup suitable for inclusion in an inline tag such as <span>.
>>> LaunchpadValidationError('<br/>oops').snippet() u'<br/>oops'
>>> from lp.services.webapp.escaping import structured >>> LaunchpadValidationError( ... structured('<a title="%s">Ok</a>', '<evil/>')).snippet() u'<a title="<evil/>">Ok</a>'
Method | __init__ | Create a LaunchpadValidationError instance. |
Method | snippet | Render as an HTML error message, as per IWidgetInputErrorView. |
Method | doc | Some code expect the error message being rendered by this |
message
should be an HTML quoted string. Extra arguments
will be HTML quoted and merged into the message using standard
Python string interpolation.