Skip to content

Commit

Permalink
PTFE-2196 authorize self bypass for admins
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmet committed Dec 9, 2024
1 parent b533cae commit 357397a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions bert_e/templates/not_enough_credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ I'm afraid I cannot do that, @{{ author }}:

> {{ comment|replace('\n', '\n> ') }}
{% if self_pr %}
You cannot use `{{ command }}` in your own pull request.
{% else %}
You don't have enough credentials to use `{{ command }}`.
{% endif %}

Please **edit** or **delete** the corresponding comment so I can move on.
{% endblock %}
4 changes: 2 additions & 2 deletions bert_e/workflow/gitwaterflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def handle_comments(job):
# Look for options in all of the pull request's comments.
for comment in job.pull_request.comments:
author = comment.author
privileged = author in admins and author != pr_author
privileged = author in admins
authored = author == pr_author
text = comment.text
try:
Expand All @@ -318,7 +318,7 @@ def handle_comments(job):
except NotPrivileged as err:
raise messages.NotEnoughCredentials(
active_options=job.active_options, command=err.keyword,
author=author, self_pr=(author == pr_author), comment=text
author=author, comment=text
) from err
except NotAuthored as err:
raise messages.NotAuthor(
Expand Down

0 comments on commit 357397a

Please sign in to comment.