mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-06 18:41:25 -04:00
Add data attributes to send errors to analytics
This commit is contained in:
@@ -195,7 +195,14 @@ def govuk_field_widget(self, field, type=None, param_extensions=None, **kwargs):
|
||||
error_message = None
|
||||
if field.errors:
|
||||
error_message_format = "html" if kwargs.get("error_message_with_html") else "text"
|
||||
error_message = {error_message_format: " ".join(field.errors).strip()}
|
||||
error_message = {
|
||||
"attributes": {
|
||||
"data-module": "track-error",
|
||||
"data-error-type": field.errors[0],
|
||||
"data-error-label": field.name
|
||||
},
|
||||
error_message_format: " ".join(field.errors).strip()
|
||||
}
|
||||
|
||||
# convert to parameters that govuk understands
|
||||
params = {
|
||||
|
||||
Reference in New Issue
Block a user