Move login related structs and functions to models/login (#17093)

* Move login related structs and functions to models/login

* Fix test

* Fix lint

* Fix lint

* Fix lint of windows

* Fix lint

* Fix test

* Fix test

* Only load necessary fixtures when preparing unit tests envs

* Fix lint

* Fix test

* Fix test

* Fix error log

* Fix error log

* Fix error log

* remove unnecessary change

* fix error log

* merge main branch
This commit is contained in:
2021-09-24 19:32:56 +08:00
committed by GitHub
parent 4a2655098f
commit 5842a55b31
142 changed files with 1050 additions and 907 deletions

View File

@ -47,7 +47,7 @@ func init() {
// SearchTeamOptions holds the search options
type SearchTeamOptions struct {
ListOptions
db.ListOptions
UserID int64
Keyword string
OrgID int64
@ -56,7 +56,7 @@ type SearchTeamOptions struct {
// SearchMembersOptions holds the search options
type SearchMembersOptions struct {
ListOptions
db.ListOptions
}
// SearchTeam search for teams. Caller is responsible to check permissions.
@ -176,7 +176,7 @@ func (t *Team) GetRepositories(opts *SearchTeamOptions) error {
return t.getRepositories(db.GetEngine(db.DefaultContext))
}
return t.getRepositories(getPaginatedSession(opts))
return t.getRepositories(db.GetPaginatedSession(opts))
}
func (t *Team) getMembers(e db.Engine) (err error) {
@ -190,7 +190,7 @@ func (t *Team) GetMembers(opts *SearchMembersOptions) (err error) {
return t.getMembers(db.GetEngine(db.DefaultContext))
}
return t.getMembers(getPaginatedSession(opts))
return t.getMembers(db.GetPaginatedSession(opts))
}
// AddMember adds new membership of the team to the organization,