1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #21375 -- related_name='+' clashed with other '+' names

This commit is contained in:
Anssi Kääriäinen
2013-11-02 21:16:33 +02:00
parent 18c642b96c
commit 9f76ea1eaa
3 changed files with 24 additions and 1 deletions

View File

@@ -309,7 +309,7 @@ def get_validation_errors(outfile, app=None):
# occurs for symmetrical m2m relations to self). If this is the
# case, there are no clashes to check for this field, as there are
# no reverse descriptors for this field.
if rel_name is not None:
if not f.rel.is_hidden():
for r in rel_opts.fields:
if r.name == rel_name:
e.add(opts, "Accessor for m2m field '%s' clashes with field '%s.%s'. Add a related_name argument to the definition for '%s'." % (f.name, rel_opts.object_name, r.name, f.name))