feat: fix password not updated bug when updating syncer (#2945)

This commit is contained in:
DacongDA 2024-05-13 00:12:35 +08:00 committed by GitHub
parent b6b0b7d318
commit 21c151bcf8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -155,7 +155,8 @@ 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
@ -163,7 +164,7 @@ func UpdateSyncer(id string, syncer *Syncer) (bool, error) {
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 {