Skip to content

Commit

Permalink
Issue #3467 - Part 5. Simplify comment_closed_reason
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Taylor committed Sep 1, 2020
1 parent 5378b48 commit 8d7954b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions webcompat/webhooks/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,10 @@ def close_private_issue(self):

def comment_closed_reason(self, reason):
"""Publish a comment on the public issue about why it was closed."""
if reason == 'invalid':
comment = moderation_template(reason).get('body')
elif reason == 'incomplete':
if reason in ['invalid', 'incomplete']:
comment = moderation_template(reason).get('body')
else:
raise ValueError("Invalid reason")
raise ValueError("reason must be one of invalid or incomplete")
payload = {'body': comment}
issue_number = self.get_public_issue_number()
path = f'repos/{PUBLIC_REPO}/{issue_number}/comments'
Expand Down

0 comments on commit 8d7954b

Please sign in to comment.