Skip to content

Commit 5fe42ae

Browse files
committed
Fix error log
1 parent edcde32 commit 5fe42ae

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

models/login/source.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ func CreateSource(source *Source) error {
247247
if err != nil {
248248
// remove the LoginSource in case of errors while registering configuration
249249
if _, err := db.GetEngine(db.DefaultContext).Delete(source); err != nil {
250-
log.Error("CreateLoginSource: Error while wrapOpenIDConnectInitializeError: %v", err)
250+
log.Error("CreateSource: Error while wrapOpenIDConnectInitializeError: %v", err)
251251
}
252252
}
253253
return err
@@ -294,7 +294,7 @@ func IsSSPIEnabled() bool {
294294
}
295295
sources, err := ActiveSources(SSPI)
296296
if err != nil {
297-
log.Error("ActiveLoginSources: %v", err)
297+
log.Error("ActiveSources: %v", err)
298298
return false
299299
}
300300
return len(sources) > 0

routers/api/v1/admin/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func parseLoginSource(ctx *context.APIContext, u *models.User, sourceID int64, l
3333
if login.IsErrSourceNotExist(err) {
3434
ctx.Error(http.StatusUnprocessableEntity, "", err)
3535
} else {
36-
ctx.Error(http.StatusInternalServerError, "GetLoginSourceByID", err)
36+
ctx.Error(http.StatusInternalServerError, "login.GetSourceByID", err)
3737
}
3838
return
3939
}

routers/web/admin/auths.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,15 +401,15 @@ func EditAuthSourcePost(ctx *context.Context) {
401401
func DeleteAuthSource(ctx *context.Context) {
402402
source, err := login.GetSourceByID(ctx.ParamsInt64(":authid"))
403403
if err != nil {
404-
ctx.ServerError("GetLoginSourceByID", err)
404+
ctx.ServerError("login.GetSourceByID", err)
405405
return
406406
}
407407

408408
if err = auth_service.DeleteLoginSource(source); err != nil {
409409
if login.IsErrSourceInUse(err) {
410410
ctx.Flash.Error(ctx.Tr("admin.auths.still_in_used"))
411411
} else {
412-
ctx.Flash.Error(fmt.Sprintf("DeleteSource: %v", err))
412+
ctx.Flash.Error(fmt.Sprintf("DeleteLoginSource: %v", err))
413413
}
414414
ctx.JSON(http.StatusOK, map[string]interface{}{
415415
"redirect": setting.AppSubURL + "/admin/auths/" + ctx.Params(":authid"),

routers/web/admin/users.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func NewUser(ctx *context.Context) {
6060

6161
sources, err := login.Sources()
6262
if err != nil {
63-
ctx.ServerError("LoginSources", err)
63+
ctx.ServerError("login.Sources", err)
6464
return
6565
}
6666
ctx.Data["Sources"] = sources
@@ -79,7 +79,7 @@ func NewUserPost(ctx *context.Context) {
7979

8080
sources, err := login.Sources()
8181
if err != nil {
82-
ctx.ServerError("LoginSources", err)
82+
ctx.ServerError("login.Sources", err)
8383
return
8484
}
8585
ctx.Data["Sources"] = sources
@@ -180,7 +180,7 @@ func prepareUserInfo(ctx *context.Context) *models.User {
180180
if u.LoginSource > 0 {
181181
ctx.Data["LoginSource"], err = login.GetSourceByID(u.LoginSource)
182182
if err != nil {
183-
ctx.ServerError("GetLoginSourceByID", err)
183+
ctx.ServerError("login.GetSourceByID", err)
184184
return nil
185185
}
186186
} else {
@@ -189,7 +189,7 @@ func prepareUserInfo(ctx *context.Context) *models.User {
189189

190190
sources, err := login.Sources()
191191
if err != nil {
192-
ctx.ServerError("LoginSources", err)
192+
ctx.ServerError("login.Sources", err)
193193
return nil
194194
}
195195
ctx.Data["Sources"] = sources

routers/web/user/oauth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ func AuthorizeOAuth(ctx *context.Context) {
316316

317317
user, err := models.GetUserByID(app.UID)
318318
if err != nil {
319-
ctx.ServerError("LoadUser", err)
319+
ctx.ServerError("GetUserByID", err)
320320
return
321321
}
322322

0 commit comments

Comments
 (0)