Lotterleben/sponsor-hook

can't add person to sponsors who is already a knurling team member

Lotterleben opened this issue · 0 comments

This may become a problem with re-subscribers

127.0.0.1 - - [04/Dec/2020 17:06:19] "POST /payload HTTP/1.1" 500 748
got request:
<LocalRequest: POST http://localhost:4567/payload>
{'action': 'created', 'sponsorship': {'sponsor': {'login': 'Lotterleben', 'id': 581552, 'node_id': 'MDQ6VXNlcjU4MTU1Mg==', 'avatar_url': 'https://avatars1.githubusercontent.com/u/581552?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/Lotterleben', 'html_url': 'https://github.com/Lotterleben', 'followers_url': 'https://api.github.com/users/Lotterleben/followers', 'following_url': 'https://api.github.com/users/Lotterleben/following{/other_user}', 'gists_url': 'https://api.github.com/users/Lotterleben/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/Lotterleben/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/Lotterleben/subscriptions', 'organizations_url': 'https://api.github.com/users/Lotterleben/orgs', 'repos_url': 'https://api.github.com/users/Lotterleben/repos', 'events_url': 'https://api.github.com/users/Lotterleben/events{/privacy}', 'received_events_url': 'https://api.github.com/users/Lotterleben/received_events', 'type': 'User', 'site_admin': False}}}
our new sponsor is:  581552
adding sponsor with id <built-in function id>
Failed to add sponsor "581552"
Response: b'{"message":"Validation Failed","errors":[{"resource":"OrganizationInvitation","code":"unprocessable","field":"data","message":"Invitee is already a part of this org"}],"documentation_url":"https://docs.github.com/rest/reference/orgs#create-an-organization-invitation"}'
127.0.0.1 - - [04/Dec/2020 17:07:03] "POST /payload HTTP/1.1" 200 6