From e9a74e4ea4a99314f4d38934bbafec305a08366e Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 8 Mar 2016 10:27:57 -0300 Subject: [PATCH] =?UTF-8?q?Usa=20cancel=5Furl=20na=20confirma=C3=A7=C3=A3o?= =?UTF-8?q?=20de=20apagar=20no=20crud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crud.py | 4 ++++ templates/crud/confirm_delete.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crud.py b/crud.py index 57cfd2e22..41548d106 100644 --- a/crud.py +++ b/crud.py @@ -162,6 +162,10 @@ class CrudDeleteMixin(FormMessagesMixin): form_invalid_message = make_form_invalid_message( _('O registro não foi excluído.')) + @property + def cancel_url(self): + return self.detail_url + def get_success_url(self): return self.list_url diff --git a/templates/crud/confirm_delete.html b/templates/crud/confirm_delete.html index 367f5857d..685c0d4ac 100644 --- a/templates/crud/confirm_delete.html +++ b/templates/crud/confirm_delete.html @@ -10,7 +10,7 @@ {% endblocktrans %}
- {% trans 'Cancelar' %} + {% trans 'Cancelar' %}