      foreign keys Django should use using ``through_fields``, as in the example
      above.
  
      ``through_fields`` accepts a 2-tuple ``('field1', 'field2')``, where
      ``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).
  
      When you have more than one foreign key on an intermediary model to any
      (or even both) of the models participating in a many-to-many relationship,
      you *must* specify ``through_fields``. This also applies to
      :ref:`recursive relationships <recursive-relationships>`
 
</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   to the target model (this would be ``Person`` in our example), or you must
 </s> add   to the source model (this would be ``Group`` in our example), or you must </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         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(
                ("The intermediary model 'invalid_models_tests.Invitation' has no field 'invalid_field_1'."),
                hint="Did you mean one of the following foreign keys to 'Event': event?",
                obj=field,
                id='fields.E338'),
            Error(
                ("The intermediary model 'invalid_models_tests.Invitation' has no field 'invalid_field_2'."),
                hint="Did you mean one of the following foreign keys to 'Fan': invitee, inviter?",
                obj=field,
                id='fields.E338'),
        ]
        self.assertEqual(expected, errors)
    ``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).
      foreign keys Django should use using ``through_fields``, as in the example
      above.
  
      ``through_fields`` accepts a 2-tuple ``('field1', 'field2')``, where
    ``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).
    ``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).
    ``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).
  
      When you have more than one foreign key on an intermediary model to any
      (or even both) of the models participating in a many-to-many relationship,
      you *must* specify ``through_fields``. This also applies to
      :ref:`recursive relationships <recursive-relationships>`
keep keep keep keep replace replace 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/ref/models/fields.txt