              name = models.CharField(max_length=128)
              members = models.ManyToManyField(Person, through='Membership', through_fields=('person', 'group'))
  
          class Membership(models.Model):
              person = models.ForeignKey(Person)
              group = models.ForeignKey(Group)
              inviter = models.ForeignKey(Person, related_name="membership_invites")
              invite_reason = models.CharField(max_length=64)
  
      ``Membership`` has *two* foreign keys to ``Person`` (``person`` and
 
</s> remove             members = models.ManyToManyField(Person, through='Membership', through_fields=('person', 'group'))
 </s> add             members = models.ManyToManyField(Person, through='Membership', through_fields=('group', 'person')) </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) </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             invitees = models.ManyToManyField(Fan, through='Invitation', through_fields=('event', 'invalid_field'))
 </s> add             invitees = models.ManyToManyField(Fan, through='Invitation', through_fields=('invalid_field_1', 'invalid_field_2'))
              name = models.CharField(max_length=128)
              members = models.ManyToManyField(Person, through='Membership', through_fields=('person', 'group'))
  
          class Membership(models.Model):

              group = models.ForeignKey(Group)
              inviter = models.ForeignKey(Person, related_name="membership_invites")
              invite_reason = models.CharField(max_length=64)
  
      ``Membership`` has *two* foreign keys to ``Person`` (``person`` and
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/ref/models/fields.txt