Add translation support to CoreDeleteView

This commit is contained in:
Christopher C. Wells 2019-11-09 13:50:28 -08:00 committed by Christopher Charbonneau Wells
parent 2eaeaed364
commit cce4855b52
1 changed files with 3 additions and 2 deletions

View File

@ -40,8 +40,9 @@ class CoreDeleteView(PermissionRequired403Mixin, DeleteView):
See: https://code.djangoproject.com/ticket/21936 See: https://code.djangoproject.com/ticket/21936
""" """
def delete(self, request, *args, **kwargs): def delete(self, request, *args, **kwargs):
success_message = '{} entry deleted.'.format( success_message = _('%(model)s entry deleted.') % {
self.model._meta.verbose_name.title()) 'model': self.model._meta.verbose_name.title()
}
messages.success(request, success_message) messages.success(request, success_message)
return super(CoreDeleteView, self).delete(request, *args, **kwargs) return super(CoreDeleteView, self).delete(request, *args, **kwargs)