Fixed #2828, a TypeError when deleting objects with m2m relations to self. Thanks, Brian Beck.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4616 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
cb1ff2af35
commit
f3cc581f3a
|
@ -461,6 +461,9 @@ def _get_deleted_objects(deleted_objects, perms_needed, user, obj, opts, current
|
|||
opts_seen.append(related.opts)
|
||||
rel_opts_name = related.get_accessor_name()
|
||||
has_related_objs = False
|
||||
|
||||
# related.get_accessor_name() could return None for symmetrical relationships
|
||||
if rel_opts_name:
|
||||
rel_objs = getattr(obj, rel_opts_name, None)
|
||||
if rel_objs:
|
||||
has_related_objs = True
|
||||
|
|
Loading…
Reference in New Issue