From a0433627a002570aaf130d68d702308e7d43cc3d Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 17 Jan 2006 00:06:47 +0000 Subject: [PATCH] magic-removal: Fixed links on delete 'Are you sure' page git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2024 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/views/stages/delete.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/django/contrib/admin/views/stages/delete.py b/django/contrib/admin/views/stages/delete.py index 84a450b6e7..f8dd8dd765 100644 --- a/django/contrib/admin/views/stages/delete.py +++ b/django/contrib/admin/views/stages/delete.py @@ -46,8 +46,8 @@ def _get_deleted_objects(deleted_objects, perms_needed, user, obj, opts, current nh(deleted_objects, current_depth, ['%s: %s' % (capfirst(related.opts.verbose_name), sub_obj), []]) else: # Display a link to the admin page. - nh(deleted_objects, current_depth, ['%s: %s' % \ - (capfirst(related.opts.verbose_name), related.opts.app_label, related.opts.module_name, + nh(deleted_objects, current_depth, ['%s: %s' % \ + (capfirst(related.opts.verbose_name), related.opts.app_label, related.opts.object_name.lower(), getattr(sub_obj, related.opts.pk.attname), sub_obj), []]) _get_deleted_objects(deleted_objects, perms_needed, user, sub_obj, related.opts, current_depth+2) else: @@ -60,8 +60,8 @@ def _get_deleted_objects(deleted_objects, perms_needed, user, obj, opts, current nh(deleted_objects, current_depth, ['%s: %s' % (capfirst(related.opts.verbose_name), escape(str(sub_obj))), []]) else: # Display a link to the admin page. - nh(deleted_objects, current_depth, ['%s: %s' % \ - (capfirst(related.opts.verbose_name), related.opts.app_label, related.opts.module_name, getattr(sub_obj, related.opts.pk.attname), escape(str(sub_obj))), []]) + nh(deleted_objects, current_depth, ['%s: %s' % \ + (capfirst(related.opts.verbose_name), related.opts.app_label, related.opts.object_name.lower(), getattr(sub_obj, related.opts.pk.attname), escape(str(sub_obj))), []]) _get_deleted_objects(deleted_objects, perms_needed, user, sub_obj, related.opts, current_depth+2) # If there were related objects, and the user doesn't have # permission to delete them, add the missing perm to perms_needed.