Skip checking GitHub on non-GitHub projects (#1275)
Skip checking GitHub on non-GitHub projects (#1275)

This is a minor optimization and cleanup.

If a user tries to edit a badge entry and is logged in via GitHub,
but is *NOT* editing a project whose repo is on GitHub, then there's
no need to ask GitHub if the user can edit the project... so don't.

This refactors some code into a new can_current_user_edit_on_github?
method, which should make can_edit? shorter and easier to understand.

Signed-off-by: David A. Wheeler <9ae72d22d8b894b865a7a496af4fab6320e6abb2@dwheeler.com>
coreinfrastructure/best-practices-badge,coreinfrastructure/best-practices-badge,coreinfrastructure/best-practices-badge,coreinfrastructure/best-practices-badge,linuxfoundation/cii-best-practices-badge,linuxfoundation/cii-best-practices-badge,linuxfoundation/cii-best-practices-badge,linuxfoundation/cii-best-practices-badge