#4295 Fix delete permission detection for PRs against the same repo
Closed by pingou. Opened by puiterwijk.
puiterwijk/pagure fix_delete_difproj  into  master

Download 4295.patch

If the repository the PR is against is the same as the PR is from, "request.project_from"
is None, and we should check "request.project" to see whether the person has permission
to delete branches.

This was causing "repo_obj" in is_repo_committer to be None.
The reason this wasn't encountered by any admins is because is_repo_committer returns
True with "is_admin()" before it even gets to using repo_obj.

Signed-off-by: Patrick Uiterwijk patrick@puiterwijk.org

rebased onto eb4d17dd0a9db25bea7540718761bfaa69063afb

Oh, nice catch!

Should we add tests for this somewhere?

:thumbsup:

rebased onto e88504bcc0f55830a3c0925b3175009d46e86e42

I'd love to get this in 5.4 but I'd want unit-tests for it :(

With the recent work on the rebase button I wonder if this is still valid.

Fixed in https://pagure.io/pagure/pull-request/4675

Pull-Request has been closed by pingou

Metadata