diff --git a/wagtail/wagtailadmin/messages.py b/wagtail/wagtailadmin/messages.py index 30703cf678..a1b0c95c72 100644 --- a/wagtail/wagtailadmin/messages.py +++ b/wagtail/wagtailadmin/messages.py @@ -6,10 +6,11 @@ from django.template.loader import render_to_string from django.utils.html import format_html, format_html_join -def render(message, buttons): +def render(message, buttons, detail=''): return render_to_string('wagtailadmin/shared/messages.html', { 'message': message, 'buttons': buttons, + 'detail': detail, }) @@ -37,7 +38,7 @@ def validation_error(request, message, form, buttons=None): if not form.non_field_errors(): # just output the generic "there were validation errors" message, and leave # the per-field highlighting to do the rest - full_message = message + detail = '' else: # display the full list of field and non-field validation errors all_errors = [] @@ -55,9 +56,9 @@ def validation_error(request, message, form, buttons=None): all_errors.append(prefix + error) errors_html = format_html_join('\n', '