mirror of
https://github.com/django/django.git
synced 2025-07-06 18:59:13 +00:00
magic-removal: fixed #1489 - objects with 1-to-1 relations may be deleted in the admin (thanks, Christopher Lenz)
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2538 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
3c7e06e103
commit
8d238ce536
@ -405,7 +405,7 @@ def _get_deleted_objects(deleted_objects, perms_needed, user, obj, opts, current
|
|||||||
rel_opts_name = related.get_accessor_name()
|
rel_opts_name = related.get_accessor_name()
|
||||||
if isinstance(related.field.rel, models.OneToOne):
|
if isinstance(related.field.rel, models.OneToOne):
|
||||||
try:
|
try:
|
||||||
sub_obj = getattr(obj, 'get_%s' % rel_opts_name)()
|
sub_obj = getattr(obj, rel_opts_name)
|
||||||
except ObjectDoesNotExist:
|
except ObjectDoesNotExist:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user