Skip to content

Commit 92972a4

Browse files
committed
chore lint and doc
1 parent 61155ec commit 92972a4

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

modules/convert/auth_source.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
api "code.gitea.io/gitea/modules/structs"
1010
)
1111

12-
// ToAuthSources convert a list of models.LoginSource to a list of api.AuthSource
12+
// ToAuthSources convert a list of auth.Source to a list of api.AuthSource
1313
func ToAuthSources(sources []*auth.Source) ([]*api.AuthSource, error) {
1414
result := make([]*api.AuthSource, len(sources))
1515
for i, source := range sources {
@@ -22,7 +22,7 @@ func ToAuthSources(sources []*auth.Source) ([]*api.AuthSource, error) {
2222
return result, nil
2323
}
2424

25-
// ToAuthSource convert a auth.LoginSource to a api.AuthSource
25+
// ToAuthSource convert a auth.Source to a api.AuthSource
2626
func ToAuthSource(source *auth.Source) (*api.AuthSource, error) {
2727
cfg, err := source.Cfg.ToDB()
2828
if err != nil {

routers/api/v1/admin/auths.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,7 @@ func DeleteAuthSource(ctx *context.APIContext) {
176176
}
177177

178178
if err = auth_service.DeleteSource(source); err != nil {
179-
if auth.IsErrSourceInUse(err) {
180-
ctx.Error(http.StatusInternalServerError, "auth_service.DeleteSource", err)
181-
} else {
182-
ctx.Error(http.StatusInternalServerError, "auth_service.DeleteSource", err)
183-
}
179+
ctx.Error(http.StatusInternalServerError, "auth_service.DeleteSource", err)
184180
return
185181
}
186182
ctx.Status(http.StatusNoContent)

0 commit comments

Comments
 (0)