1
0
mirror of https://github.com/django/django.git synced 2024-12-23 17:46:27 +00:00

Fixed a missing piece of [8721].

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2008-08-29 21:48:40 +00:00
parent f3e088d2d9
commit 38362a1276

View File

@ -850,7 +850,7 @@ class ManyToManyField(RelatedField, Field):
# specify *what* on my non-reversible relation?!"), so we set it up
# automatically. The funky name reduces the chance of an accidental
# clash.
if self.rel.symmetrical and self.rel.related_name is None:
if self.rel.symmetrical and self.rel.to == "self" and self.rel.related_name is None:
self.rel.related_name = "%s_rel_+" % name
super(ManyToManyField, self).contribute_to_class(cls, name)