forked from forgejo/forgejo
Remove Unused Functions (#10516)
* remove ReplaceLeft * remove GetRepositoryByOwnerAndName chainload to models.GetRepositoryByOwnerAndName * remove CheckUnitUser chainload to models.CheckUnitUser * remove MakeAssigneeList * remove DownloadDiff & DownloadPatch -> DownloadDiffOrPatch * remove GetRandomBytesAsBase64 * remove PushUpdateDeleteTags * remove GetUserByKeyID (you still can resolve user by "k, err := GetPublicKeyByID; userID := k.OwnerID") * remove BasicAuthEncode from struct package -> same function in modules/base/tools ! * remove UserID from api.utils * remove unused func from structs package
This commit is contained in:
parent
c08c975d36
commit
4160bd6ef1
10 changed files with 0 additions and 179 deletions
|
@ -1315,21 +1315,6 @@ func UserPath(userName string) string {
|
|||
return filepath.Join(setting.RepoRootPath, strings.ToLower(userName))
|
||||
}
|
||||
|
||||
// GetUserByKeyID get user information by user's public key id
|
||||
func GetUserByKeyID(keyID int64) (*User, error) {
|
||||
var user User
|
||||
has, err := x.Join("INNER", "public_key", "`public_key`.owner_id = `user`.id").
|
||||
Where("`public_key`.id=?", keyID).
|
||||
Get(&user)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !has {
|
||||
return nil, ErrUserNotExist{0, "", keyID}
|
||||
}
|
||||
return &user, nil
|
||||
}
|
||||
|
||||
func getUserByID(e Engine, id int64) (*User, error) {
|
||||
u := new(User)
|
||||
has, err := e.ID(id).Get(u)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue