Skip to content

Commit

Permalink
Fix wrong xorm Delete usage(backport for 1.21) (#28002)
Browse files Browse the repository at this point in the history
manually backport for #27995
The conflict is `ctx` and `db.Defaultctx`.
  • Loading branch information
lng2020 authored Nov 12, 2023
1 parent 58d71cd commit 97f4239
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/auth/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 97f4239

Please sign in to comment.