Skip to content

Commit

Permalink
External status: use admin users to hit VCS API
Browse files Browse the repository at this point in the history
We were using `AdminPermission.members`. However, that will return
`RemoteRepositoryRelation.admin=False`, so those users may not have permissions
to update the VCS status.

By using `AdminPermission.admins` we are sure the user selected will have
permissions to make this request.
  • Loading branch information
humitos committed Apr 13, 2022
1 parent ccdad23 commit fcbe32c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion readthedocs/builds/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def send_build_status(build_pk, commit, status, link_to_build=False):
# Use ``user_in=`` instead of ``user__projects=`` here
# because User's are not related to Project's directly in
# Read the Docs for Business
user__in=AdminPermission.members(build.project),
user__in=users,
).select_related('account', 'user').only('user', 'account')
)

Expand Down

0 comments on commit fcbe32c

Please sign in to comment.