mirror of
https://github.com/go-gitea/gitea.git
synced 2025-04-08 17:05:45 +02:00
fix: rename to GetPossibleUserByID
This commit is contained in:
parent
0887e98f2a
commit
6148e4c940
@ -72,7 +72,7 @@ func (run *ActionRun) LoadAttributes(ctx context.Context) error {
|
||||
}
|
||||
|
||||
if run.TriggerUser == nil {
|
||||
u, err := user_model.GetPossbileUserByID(ctx, run.TriggerUserID)
|
||||
u, err := user_model.GetPossibleUserByID(ctx, run.TriggerUserID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ func (c *Comment) LoadPoster(ctx context.Context) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
c.Poster, err = user_model.GetPossbileUserByID(ctx, c.PosterID)
|
||||
c.Poster, err = user_model.GetPossibleUserByID(ctx, c.PosterID)
|
||||
if err != nil {
|
||||
if user_model.IsErrUserNotExist(err) {
|
||||
c.PosterID = -1
|
||||
|
@ -235,7 +235,7 @@ func (issue *Issue) LoadLabels(ctx context.Context) (err error) {
|
||||
// LoadPoster loads poster
|
||||
func (issue *Issue) LoadPoster(ctx context.Context) (err error) {
|
||||
if issue.Poster == nil {
|
||||
issue.Poster, err = user_model.GetPossbileUserByID(ctx, issue.PosterID)
|
||||
issue.Poster, err = user_model.GetPossibleUserByID(ctx, issue.PosterID)
|
||||
if err != nil {
|
||||
issue.PosterID = -1
|
||||
issue.Poster = user_model.NewGhostUser()
|
||||
|
@ -158,7 +158,7 @@ func (r *Review) LoadReviewer(ctx context.Context) (err error) {
|
||||
if r.ReviewerID == 0 || r.Reviewer != nil {
|
||||
return
|
||||
}
|
||||
r.Reviewer, err = user_model.GetPossbileUserByID(ctx, r.ReviewerID)
|
||||
r.Reviewer, err = user_model.GetPossibleUserByID(ctx, r.ReviewerID)
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -988,8 +988,8 @@ func GetUserByID(ctx context.Context, id int64) (*User, error) {
|
||||
return u, nil
|
||||
}
|
||||
|
||||
// GetPossbileUserByID returns the user if id > 0 or return system usrs if id < 0
|
||||
func GetPossbileUserByID(ctx context.Context, id int64) (*User, error) {
|
||||
// GetPossibleUserByID returns the user if id > 0 or return system usrs if id < 0
|
||||
func GetPossibleUserByID(ctx context.Context, id int64) (*User, error) {
|
||||
switch id {
|
||||
case -1:
|
||||
return NewGhostUser(), nil
|
||||
|
@ -132,7 +132,7 @@ func (o *OAuth2) Verify(req *http.Request, w http.ResponseWriter, store DataStor
|
||||
}
|
||||
log.Trace("OAuth2 Authorization: Found token for user[%d]", id)
|
||||
|
||||
user, err := user_model.GetPossbileUserByID(req.Context(), id)
|
||||
user, err := user_model.GetPossibleUserByID(req.Context(), id)
|
||||
if err != nil {
|
||||
if !user_model.IsErrUserNotExist(err) {
|
||||
log.Error("GetUserByName: %v", err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user