Ticket #14529: 14529-save-messages-for-proxy-models.diff

File 14529-save-messages-for-proxy-models.diff, 597 bytes (added by rlaager@…, 14 years ago)

A trivial patch to fix this issue

  • django/contrib/admin/options.py

    diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
    index e6a1fd2..1d7902e 100644
    a b class ModelAdmin(BaseModelAdmin):  
    669669        Determines the HttpResponse for the change_view stage.
    670670        """
    671671        opts = obj._meta
     672        while opts.proxy:
     673            opts = opts.proxy_for_model._meta
    672674        pk_value = obj._get_pk_val()
    673675
    674676        msg = _('The %(name)s "%(obj)s" was changed successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': force_unicode(obj)}
Back to Top