Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed display bug in admin when deleting an object that has a OneToOn…

…eField

git-svn-id: http://code.djangoproject.com/svn/django/trunk@577 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e1f0accaf6ca331fd9b1bcca2faedd47033ff95e 1 parent 02ebeec
@adrianholovaty adrianholovaty authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/views/admin/main.py
View
4 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: <a href="../../../../%s/%s/%s/">%r</a>' % \
(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
Please sign in to comment.
Something went wrong with that request. Please try again.