From b5995807c659eb8d166974863d21655cdfdb3022 Mon Sep 17 00:00:00 2001 From: lng2020 Date: Sun, 12 Nov 2023 16:35:22 +0800 Subject: [PATCH] backport --- models/auth/source.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/auth/source.go b/models/auth/source.go index 0a904b7772394..6fdd2006fe442 100644 --- a/models/auth/source.go +++ b/models/auth/source.go @@ -232,7 +232,7 @@ func CreateSource(source *Source) error { err = registerableSource.RegisterSource() if err != nil { // remove the AuthSource in case of errors while registering configuration - if _, err := db.GetEngine(db.DefaultContext).Delete(source); err != nil { + if _, err := db.GetEngine(db.DefaultContext).ID(source.ID).Delete(new(Source)); err != nil { log.Error("CreateSource: Error while wrapOpenIDConnectInitializeError: %v", err) } }