forked from forgejo/forgejo
[MODERATION] Add repo transfers to blocked functionality (squash)
- When someone gets blocked, remove all pending repository transfers from the blocked user to the doer. - Do not allow to start transferring repositories to the doer as blocked user. - Added unit testing. - Added integration testing. (cherry picked from commit8a3caac330
) (cherry picked from commita92b4cfeb6
) (cherry picked from commitacaaaf07d9
) (cherry picked from commit735818863c
)
This commit is contained in:
parent
bb23683f4b
commit
f50fa43b32
11 changed files with 111 additions and 12 deletions
|
@ -417,3 +417,13 @@ func TransferOwnership(ctx context.Context, doer *user_model.User, newOwnerName
|
|||
|
||||
return committer.Commit()
|
||||
}
|
||||
|
||||
// GetPendingTransfers returns the pending transfers of recipient which were sent by by doer.
|
||||
func GetPendingTransferIDs(ctx context.Context, reciepientID, doerID int64) ([]int64, error) {
|
||||
pendingTransferIDs := make([]int64, 0, 8)
|
||||
return pendingTransferIDs, db.GetEngine(ctx).Table("repo_transfer").
|
||||
Where("doer_id = ?", doerID).
|
||||
And("recipient_id = ?", reciepientID).
|
||||
Cols("id").
|
||||
Find(&pendingTransferIDs)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue