summaryrefslogtreecommitdiffstats
path: root/models/repo_collaboration.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-10 03:57:58 +0800
committerGitHub <noreply@github.com>2021-11-09 20:57:58 +0100
commit99b2858e628d92bba252be72def409af77af735b (patch)
tree56159cf10b271307911e6f01626c0c3efba789ab /models/repo_collaboration.go
parentb6b1e716654fec3b16d245ef65cf42e57e1bb5b6 (diff)
downloadgitea-99b2858e628d92bba252be72def409af77af735b.tar.gz
gitea-99b2858e628d92bba252be72def409af77af735b.zip
Move unit into models/unit/ (#17576)
* Move unit into models/unit/ * Rename unit.UnitType as unit.Type
Diffstat (limited to 'models/repo_collaboration.go')
-rw-r--r--models/repo_collaboration.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/models/repo_collaboration.go b/models/repo_collaboration.go
index bc9d0100ef..dd362406cf 100644
--- a/models/repo_collaboration.go
+++ b/models/repo_collaboration.go
@@ -9,6 +9,7 @@ import (
"fmt"
"code.gitea.io/gitea/models/db"
+ "code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/timeutil"
@@ -276,7 +277,7 @@ func (repo *Repository) IsOwnerMemberCollaborator(userID int64) (bool, error) {
teamMember, err := db.GetEngine(db.DefaultContext).Join("INNER", "team_repo", "team_repo.team_id = team_user.team_id").
Join("INNER", "team_unit", "team_unit.team_id = team_user.team_id").
Where("team_repo.repo_id = ?", repo.ID).
- And("team_unit.`type` = ?", UnitTypeCode).
+ And("team_unit.`type` = ?", unit.TypeCode).
And("team_user.uid = ?", userID).Table("team_user").Exist(&TeamUser{})
if err != nil {
return false, err