diff options
author | Nanguan Lin <70063547+lng2020@users.noreply.github.com> | 2023-11-12 20:31:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-12 14:31:03 +0200 |
commit | c077a084d7bac8acc1bd247b2bd3d60835a17ded (patch) | |
tree | 882d09bf27ab30e9e397f8241f8fbafff703a1f6 | |
parent | dfd960f22a7dafaa65b9f96e61ec8bef9ea5ea69 (diff) | |
download | gitea-c077a084d7bac8acc1bd247b2bd3d60835a17ded.tar.gz gitea-c077a084d7bac8acc1bd247b2bd3d60835a17ded.zip |
Fix wrong xorm Delete usage(backport for 1.20) (#28003)
manually backport for https://github.com/go-gitea/gitea/pull/27995
The conflict is `ctx` and `db.Defaultctx`.
-rw-r--r-- | models/auth/source.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/auth/source.go b/models/auth/source.go index 0a904b7772..6fdd2006fe 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) } } |