mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
models/login_source: code improvement
This commit is contained in:
@@ -242,10 +242,9 @@ func DeleteAuthSource(ctx *context.Context) {
|
||||
}
|
||||
|
||||
if err = models.DeleteSource(source); err != nil {
|
||||
switch err {
|
||||
case models.ErrAuthenticationUserUsed:
|
||||
if models.IsErrLoginSourceInUse(err) {
|
||||
ctx.Flash.Error(ctx.Tr("admin.auths.still_in_used"))
|
||||
default:
|
||||
} else {
|
||||
ctx.Flash.Error(fmt.Sprintf("DeleteSource: %v", err))
|
||||
}
|
||||
ctx.JSON(200, map[string]interface{}{
|
||||
|
Reference in New Issue
Block a user