mirror of
https://github.com/go-gitea/gitea
synced 2025-07-16 07:18:37 +00:00
refactor some functions to support ctx as first parameter (#21878)
Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
@@ -37,7 +37,7 @@ func TestUserIsPublicMember(t *testing.T) {
|
||||
}
|
||||
|
||||
func testUserIsPublicMember(t *testing.T, uid, orgID int64, expected bool) {
|
||||
user, err := user_model.GetUserByID(uid)
|
||||
user, err := user_model.GetUserByID(db.DefaultContext, uid)
|
||||
assert.NoError(t, err)
|
||||
is, err := organization.IsPublicMembership(orgID, user.ID)
|
||||
assert.NoError(t, err)
|
||||
@@ -65,7 +65,7 @@ func TestIsUserOrgOwner(t *testing.T) {
|
||||
}
|
||||
|
||||
func testIsUserOrgOwner(t *testing.T, uid, orgID int64, expected bool) {
|
||||
user, err := user_model.GetUserByID(uid)
|
||||
user, err := user_model.GetUserByID(db.DefaultContext, uid)
|
||||
assert.NoError(t, err)
|
||||
is, err := organization.IsOrganizationOwner(db.DefaultContext, orgID, user.ID)
|
||||
assert.NoError(t, err)
|
||||
|
Reference in New Issue
Block a user