]> source.dussan.org Git - gitea.git/commit
Fix `DeleteCollaboration` transaction behaviour (#28886)
authorKN4CK3R <admin@oldschoolhack.me>
Mon, 22 Jan 2024 07:19:56 +0000 (08:19 +0100)
committerGitHub <noreply@github.com>
Mon, 22 Jan 2024 07:19:56 +0000 (07:19 +0000)
commit8e9b6817bc2032c5af607b63d70ffc7e6599ebbb
tree4c6215d0dac51478aebacf58ff7a756dd0032efd
parent23efd9d2781c2ac22594a83afa75182d276b1571
Fix `DeleteCollaboration` transaction behaviour (#28886)

The method can't be called with an outer transaction because if the user
is not a collaborator the outer transaction will be rolled back even if
the inner transaction uses the no-error path.

`has == 0` leads to `return nil` which cancels the transaction. A
standalone call of this method does nothing but if used with an outer
transaction, that will be canceled.
services/repository/collaboration.go