Do not check reaction_type before sending (#1592)

There is a bunch of repeated code checking reactions which has the issue
that it can easily get out of date with what GitHub accepts. Drop the
check, and rely on GitHub returning an error.

Fixes #1554
This commit is contained in:
Steve Kowalik
2020-07-27 14:16:52 +10:00
committed by GitHub
parent 416f2d0f2e
commit 136a3e8008
4 changed files with 4 additions and 40 deletions
+1 -10
View File
@@ -211,16 +211,7 @@ class PullRequestComment(github.GithubObject.CompletableGithubObject):
:param reaction_type: string
:rtype: :class:`github.Reaction.Reaction`
"""
assert isinstance(reaction_type, str), "reaction type should be a string"
assert reaction_type in [
"+1",
"-1",
"laugh",
"confused",
"heart",
"hooray",
], "Invalid reaction type (https://developer.github.com/v3/reactions/#reaction-types)"
assert isinstance(reaction_type, str), reaction_type
post_parameters = {
"content": reaction_type,
}