Ticket #1083: admin.diff

File admin.diff, 2.3 KB (added by Nebojša Đorđević - nesh <nesh@…>, 10 years ago)
  • django/contrib/admin/templatetags/admin_list.py

     
    8282            if field_name == '__repr__':
    8383                header = lookup_opts.verbose_name
    8484            else:
    85                 func = getattr(cl.mod.Klass, field_name) # Let AttributeErrors propogate.
     85                func = getattr(cl.model, field_name) # Let AttributeErrors propogate.
    8686                try:
    8787                    header = func.short_description
    8888                except AttributeError:
  • django/contrib/admin/views/main.py

     
    559559    if not request.user.has_perm(app_label + '.' + opts.get_change_permission()):
    560560        raise PermissionDenied
    561561    if request.POST and request.POST.has_key("_saveasnew"):
    562         return add_stage(request, path, form_url='../add/')
     562        return add_stage(request, path, form_url='../../add/')
    563563    try:
    564564        manipulator_class = model.ChangeManipulator
    565565        manipulator = manipulator_class(object_id)
     
    587587                    return HttpResponseRedirect(request.path)
    588588            elif request.POST.has_key("_saveasnew"):
    589589                request.user.add_message(_('The %(name)s "%(obj)s" was added successfully. You may edit it again below.') % {'name': opts.verbose_name, 'obj': new_object})
    590                 return HttpResponseRedirect("../%s/" % pk_value)
     590                return HttpResponseRedirect("../../%s/" % pk_value)
    591591            elif request.POST.has_key("_addanother"):
    592592                request.user.add_message(msg + ' ' + (_("You may add another %s below.") % opts.verbose_name))
    593                 return HttpResponseRedirect("../add/")
     593                return HttpResponseRedirect("../../add/")
    594594            else:
    595595                request.user.add_message(msg)
    596                 return HttpResponseRedirect("../")
     596                return HttpResponseRedirect("../../")
    597597    else:
    598598        # Populate new_data with a "flattened" version of the current data.
    599599        new_data = manipulator.flatten_data()
Back to Top