Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Improving errors on invites #94

Merged
merged 3 commits into from Mar 10, 2020
Merged

Improving errors on invites #94

merged 3 commits into from Mar 10, 2020

Conversation

arfon
Copy link
Member

@arfon arfon commented Mar 10, 2020

Try to give better errors when re-inviting authors.

existing_invitees = github_client.repository_invitations(@nwo).collect {|i| i.invitee.login.downcase }
existing_collaborators = github_client.collaborators(@nwo).collect {|c| c.login.downcase }

if existing_invitees.include?(reviewer_name)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if existing invitees include the person being invited.

whedon_api.rb Outdated

if existing_invitees.include?(reviewer_name)
respond "@#{reviewer_name} is already invited.\n\n@#{reviewer_name} please accept the invite by clicking this link: https://github.com/#{@nwo}/invitations"
elsif existing_collaborators.include?(reviewer_name)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, if they already have access say so.

@arfon arfon temporarily deployed to whedon March 10, 2020 23:19 Inactive
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant