Browse Source

Usa cancel_url na confirmação de apagar no crud

pull/249/head
Marcio Mazza 9 years ago
parent
commit
e9a74e4ea4
  1. 4
      crud.py
  2. 2
      templates/crud/confirm_delete.html

4
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

2
templates/crud/confirm_delete.html

@ -10,7 +10,7 @@
{% endblocktrans %}
</div>
<div class="panel-body text-center">
<a href="{{ view.detail_url }}" class="btn btn-inverse">{% trans 'Cancelar' %}</a>
<a href="{{ view.cancel_url }}" class="btn btn-inverse">{% trans 'Cancelar' %}</a>
<input name="submit" value="{% trans 'Confirmar' %}" class="btn btn-danger" type="submit"></li>
</div>
</div>

Loading…
Cancel
Save