aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2023-12-12 15:58:24 +0000
committerGravatar Chris Lovering <[email protected]>2023-12-12 15:58:25 +0000
commitab17a7a80e6f90a4dddb04325c29deb8065f1499 (patch)
tree8dddf9e22fbc04b561242e76fb7416b70c5292f6 /pydis_site/apps
parentConvert to lower case before checking equality (diff)
Simplify is_bot_pr_approval logic
Diffstat (limited to 'pydis_site/apps')
-rw-r--r--pydis_site/apps/api/views.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/pydis_site/apps/api/views.py b/pydis_site/apps/api/views.py
index 20c7536c..1fa3efc2 100644
--- a/pydis_site/apps/api/views.py
+++ b/pydis_site/apps/api/views.py
@@ -272,10 +272,7 @@ class GitHubWebhookFilterView(APIView):
'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'