Members with accepted invite show as Pending after Import

A member is considered pending for 2 reasons: if invite_token or requested_at is present https://gitlab.com/gitlab-org/gitlab/blob/master/app/models/member.rb#L306-306

When a user is invited to the group, exported and imported at a new destination, then these 2 fields are empty in the group export archive, but on Import:

  1. invite_email is not empty in the export
  2. Because of that, before_validation is ran https://gitlab.com/gitlab-org/gitlab/blob/master/app/models/member.rb#L93-93 to generate new invite_token
  3. Because of that, pending? returns true and user is shown in the Pending list

This looks like a bug in the Member model, as when membership is accepted we do not reset invite_email to nil (although I am not sure if we should, that's just a guess). However we can also add a bit log logic to Members Mapper to remove invite_* fields if member hash has user associated with it.