def response_add(self, request, obj, *args, **kwargs):
    resp = super(UndeletePageAdminMixin, self).response_add(request, obj, *args, **kwargs)
    if ((resp.status_code == 302) and resp['Location'].startswith('../')):
        viewname = ('admin:%s_%s_change' % (obj._meta.app_label, obj._meta.model_name))
        resp['Location'] = reverse(viewname, args=(quote(obj.pk),))
    return resp
def response_add(self, request, obj, *args, **kwargs):
    resp = super(UndeletePageAdminMixin, self).response_add(request, obj, *args, **kwargs)
    if ((resp.status_code == 302) and resp['Location'].startswith('../')):
        viewname = ('admin:%s_%s_change' % (obj._meta.app_label, obj._meta.model_name))
        resp['Location'] = reverse(viewname, args=(quote(obj.pk),))
    return resp