Skip to content

Commit

Permalink
feat: fix password not updated bug when updating syncer (#2945)
Browse files Browse the repository at this point in the history
  • Loading branch information
dacongda committed May 12, 2024
1 parent b6b0b7d commit 21c151b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions object/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,16 @@ func GetMaskedSyncers(syncers []*Syncer, errs ...error) ([]*Syncer, error) {

func UpdateSyncer(id string, syncer *Syncer) (bool, error) {
owner, name := util.GetOwnerAndNameFromId(id)
if s, err := getSyncer(owner, name); err != nil {
s, err := getSyncer(owner, name)
if err != nil {
return false, err
} else if s == nil {
return false, nil
}

session := ormer.Engine.ID(core.PK{owner, name}).AllCols()
if syncer.Password == "***" {
session.Omit("password")
syncer.Password = s.Password
}
affected, err := session.Update(syncer)
if err != nil {
Expand Down

0 comments on commit 21c151b

Please sign in to comment.