From 0cec7587cefb49d12e2a255ea0422ce98b22eea2 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 30 Jun 2014 10:20:43 +0100 Subject: [PATCH] Removed some unneeded code --- wagtail/wagtailadmin/views/pages.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/wagtail/wagtailadmin/views/pages.py b/wagtail/wagtailadmin/views/pages.py index 29f3b68bb0..84137f3630 100644 --- a/wagtail/wagtailadmin/views/pages.py +++ b/wagtail/wagtailadmin/views/pages.py @@ -210,10 +210,7 @@ def create(request, content_type_app_name, content_type_model_name, parent_page_ return redirect('wagtailadmin_explore', page.get_parent().id) else: - if form.errors and form.errors.get('__all__'): - messages.error(request, _("The page could not be created: ") + ', '.join(form.errors['__all__'])) - else: - messages.error(request, _("The page could not be created due to errors.")) + messages.error(request, _("The page could not be created due to validation errors")) edit_handler = edit_handler_class(instance=page, form=form) else: signals.init_new_page.send(sender=create, page=page, parent=parent_page) @@ -336,10 +333,7 @@ def edit(request, page_id): return redirect('wagtailadmin_explore', page.get_parent().id) else: - if form.errors and form.errors.get('__all__'): - messages.error(request, _("The page could not be saved: ") + ', '.join(form.errors['__all__'])) - else: - messages.error(request, _("The page could not be saved due to validation errors")) + messages.error(request, _("The page could not be saved due to validation errors")) edit_handler = edit_handler_class(instance=page, form=form) errors_debug = (