Ticket #1089: patch.diff

File patch.diff, 2.0 KB (added by Joseph Kocherhans <jkocherhans@…>, 19 years ago)
  • django/contrib/admin/views/main.py

     
    646646        log.log_action(request.user.id, opts.get_content_type_id(), object_id, obj_display, log.DELETION)
    647647        request.user.add_message(_('The %(name)s "%(obj)s" was deleted successfully.') % {'name':opts.verbose_name, 'obj':obj_display})
    648648        return HttpResponseRedirect("../../")
    649     return render_to_response('admin/delete_confirmation', {
     649    extra_context = {
    650650        "title": _("Are you sure?"),
    651651        "object_name": opts.verbose_name,
    652652        "object": obj,
    653653        "deleted_objects": deleted_objects,
    654654        "perms_lacking": perms_needed,
    655     }, context_instance=Context(request))
     655    }
     656    return render_to_response(["admin/%s/%s/delete_confirmation" % (app_label, opts.object_name.lower() ),
     657                               "admin/%s/delete_confirmation" % app_label ,
     658                               "admin/delete_confirmation"], extra_context, context_instance=Context(request))
    656659delete_stage = staff_member_required(delete_stage)
    657660
    658661def history(request, app_label, module_name, object_id):
     
    661664        order_by=("action_time",), select_related=True)
    662665    # If no history was found, see whether this object even exists.
    663666    obj = get_object_or_404(mod, pk=object_id)
    664     return render_to_response('admin/object_history', {
     667    extra_context = {
    665668        'title': _('Change history: %s') % obj,
    666669        'action_list': action_list,
    667670        'module_name': capfirst(opts.verbose_name_plural),
    668671        'object': obj,
    669     }, context_instance=Context(request))
     672    }
     673    return render_to_response(["admin/%s/%s/object_history" % (app_label, opts.object_name.lower() ),
     674                               "admin/%s/object_history" % app_label ,
     675                               "admin/object_history"], extra_context, context_instance=Context(request))
    670676history = staff_member_required(history)
Back to Top