Ticket #15932: m2m_validation.patch

File m2m_validation.patch, 847 bytes (added by Fredde, 14 years ago)
  • django/core/management/validation.py

     
    249249            # occurs for symmetrical m2m relations to self). If this is the
    250250            # case, there are no clashes to check for this field, as there are
    251251            # no reverse descriptors for this field.
    252             if rel_name is not None:
     252            if rel_name is not None and not f.rel.is_hidden():
    253253                for r in rel_opts.fields:
    254254                    if r.name == rel_name:
    255255                        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))
Back to Top