Correct success message for Child delete form

This commit is contained in:
Christopher C. Wells 2020-01-29 12:16:57 -08:00 committed by Christopher Charbonneau Wells
parent 107257cc34
commit 39b0df534b
1 changed files with 8 additions and 0 deletions

View File

@ -112,6 +112,14 @@ class ChildDelete(CoreUpdateView):
permission_required = ('core.delete_child',) permission_required = ('core.delete_child',)
success_url = reverse_lazy('core:child-list') success_url = reverse_lazy('core:child-list')
def get_success_message(self, cleaned_data):
""" This class cannot use `CoreDeleteView` because of the confirmation
step required so the success message must be overridden."""
success_message = _('%(model)s entry deleted.') % {
'model': self.model._meta.verbose_name.title()
}
return success_message % cleaned_data
class DiaperChangeList(PermissionRequired403Mixin, BabyBuddyFilterView): class DiaperChangeList(PermissionRequired403Mixin, BabyBuddyFilterView):
model = models.DiaperChange model = models.DiaperChange