summaryrefslogtreecommitdiffstats
path: root/routers/admin/auths.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/admin/auths.go')
-rw-r--r--routers/admin/auths.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/routers/admin/auths.go b/routers/admin/auths.go
index 8d3304eacf..df2512aa06 100644
--- a/routers/admin/auths.go
+++ b/routers/admin/auths.go
@@ -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{}{