Skip to content

Commit

Permalink
Simplify is_bot_pr_approval logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLovering committed Dec 12, 2023
1 parent c7e1c56 commit ab17a7a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pydis_site/apps/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,7 @@ def post(self, request: Request, *, webhook_id: str, webhook_token: str) -> Resp
'dependabot' in request.data.get('ref', '').lower()
and event == 'delete'
)
is_bot_pr_approval = (
'[bot]' in request.data.get('pull_request', {}).get('user', {}).get('login', '').lower()
and event == 'pull_request_review'
)
is_bot_pr_approval = is_github_bot and event == 'pull_request_review'
is_empty_review = (
request.data.get('review', {}).get('state', '').lower() == 'commented'
and event == 'pull_request_review'
Expand Down

0 comments on commit ab17a7a

Please sign in to comment.