  
  There are a few restrictions on the intermediate model:
  
  * Your intermediate model must contain one - and *only* one - foreign key
    to the target model (this would be ``Person`` in our example), or you must
    explicitly specify the foreign keys Django should use for the relationship
    using :attr:`ManyToManyField.through_fields <ManyToManyField.through_fields>`.
    If you have more than one foreign key and ``through_fields`` is not
    specified, a validation error will be raised. A similar restriction applies
    to the foreign key to the source model (this would be ``Group`` in our
 
</s> remove   to the foreign key to the source model (this would be ``Group`` in our
 </s> add   to the foreign key to the target model (this would be ``Person`` in our </s> remove     ``field1`` is the name of the foreign key to the target model (``person``
    in this case), and ``field2`` the name of the foreign key to the model the
    :class:`ManyToManyField` is defined on (``group`` in this case).
 </s> add     ``field1`` is the name of the foreign key to the model the
    :class:`ManyToManyField` is defined on (``group`` in this case), and
    ``field2`` the name of the foreign key to the target model (``person``
    in this case). </s> remove * **fields.E337**: The field is given an iterable for through_fields, which does not provide the names for both link fields that Django should use for the relation through <model>.
 </s> add * **fields.E337**: Field specifies ``through_fields`` but does not provide the names of the two link fields that should be used for the relation through ``<model>``.
* **fields.E338**: The intermediary model ``<through model>`` has no field ``<field name>``.
* **fields.E339**: ``<model>.<field name>`` is not a foreign key to ``<model>``. </s> remove         with self.assertRaisesMessage(FieldDoesNotExist, 'invalid_field'):
            Event().invitees.all()
 </s> add         field = Event._meta.get_field('invitees')
        errors = field.check(from_model=Event)
        expected = [
            Error(
                ("'Invitation.invitee' is not a foreign key to 'Event'."),
                hint="Did you mean one of the following foreign keys to 'Event': event?",
                obj=field,
                id='fields.E339'),
            Error(
                ("'Invitation.event' is not a foreign key to 'Fan'."),
                hint="Did you mean one of the following foreign keys to 'Fan': invitee, inviter?",
                obj=field,
                id='fields.E339'),
        ]
        self.assertEqual(expected, errors) </s> remove         elif self.rel.through_fields is not None:
            if not len(self.rel.through_fields) >= 2 or not (self.rel.through_fields[0] and self.rel.through_fields[1]):
                errors.append(
                    checks.Error(
                        ("The field is given an iterable for through_fields, "
                         "which does not provide the names for both link fields "
                         "that Django should use for the relation through model "
                         "'%s'.") % qualified_model_name,
                        hint=None,
                        obj=self,
                        id='fields.E337',
                    )
                )

        elif not isinstance(self.rel.through, six.string_types):
 </s> add         else:
  to the source model (this would be ``Group`` in our example), or you must
  
  There are a few restrictions on the intermediate model:
  
  * Your intermediate model must contain one - and *only* one - foreign key
  to the source model (this would be ``Group`` in our example), or you must
    explicitly specify the foreign keys Django should use for the relationship
    using :attr:`ManyToManyField.through_fields <ManyToManyField.through_fields>`.
    If you have more than one foreign key and ``through_fields`` is not
    specified, a validation error will be raised. A similar restriction applies
    to the foreign key to the source model (this would be ``Group`` in our
keep keep keep keep replace keep keep keep keep keep
 Fixed #22217 - ManyToManyField.through_fields fixes.

- Docs description of arguments mix up.
- Keep it from erroneously masking E332 check.
- Add checks E338 and E339, tweak message of E337. 
docs/topics/db/models.txt