From e1f0accaf6ca331fd9b1bcca2faedd47033ff95e Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 30 Aug 2005 17:03:15 +0000 Subject: [PATCH] Fixed display bug in admin when deleting an object that has a OneToOneField git-svn-id: http://code.djangoproject.com/svn/django/trunk@577 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/views/admin/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/views/admin/main.py b/django/views/admin/main.py index 17bfa12d8b..a8ac411180 100644 --- a/django/views/admin/main.py +++ b/django/views/admin/main.py @@ -775,7 +775,7 @@ def add_stage(request, app_label, module_name, show_delete=False, form_url='', p new_data.setlist(f.name, new_data[f.name].split(",")) manipulator.do_html2python(new_data) new_object = manipulator.save(new_data) - pk_value = getattr(new_object, opts.pk.name) + pk_value = getattr(new_object, opts.pk.column) log.log_action(request.user.id, opts.get_content_type_id(), pk_value, repr(new_object), log.ADDITION) msg = 'The %s "%s" was added successfully.' % (opts.verbose_name, new_object) # Here, we distinguish between different save types by checking for @@ -1013,7 +1013,7 @@ def _get_deleted_objects(deleted_objects, perms_needed, user, obj, opts, current # Display a link to the admin page. nh(deleted_objects, current_depth, ['%s: %r' % \ (capfirst(rel_opts.verbose_name), rel_opts.app_label, rel_opts.module_name, - getattr(sub_obj, rel_opts.pk.name), sub_obj), []]) + getattr(sub_obj, rel_opts.pk.column), sub_obj), []]) _get_deleted_objects(deleted_objects, perms_needed, user, sub_obj, rel_opts, current_depth+2) else: has_related_objs = False