mirror of https://github.com/snachodog/mybuddy.git
Add translation support to CoreDeleteView
This commit is contained in:
parent
2eaeaed364
commit
cce4855b52
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue