diff options
author | Nanguan Lin <70063547+lng2020@users.noreply.github.com> | 2023-11-12 20:58:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-12 12:58:22 +0000 |
commit | 97f4239a94d178c16d4b53bd3aa409b41a371801 (patch) | |
tree | 4223638a06c976dcabb3aa1a340cba22499c389c | |
parent | 58d71cdd6f8125bacc61f6b97b24f6909921784b (diff) | |
download | gitea-97f4239a94d178c16d4b53bd3aa409b41a371801.tar.gz gitea-97f4239a94d178c16d4b53bd3aa409b41a371801.zip |
Fix wrong xorm Delete usage(backport for 1.21) (#28002)
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) } } |