mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #15608 from Maddin-619/fix-datasource-update
Fix Datasource Update to no User/Password
This commit is contained in:
commit
71bfefa8fb
@ -174,11 +174,6 @@ func UpdateDataSource(cmd *m.UpdateDataSourceCommand) error {
|
|||||||
Version: cmd.Version + 1,
|
Version: cmd.Version + 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
sess.UseBool("is_default")
|
|
||||||
sess.UseBool("basic_auth")
|
|
||||||
sess.UseBool("with_credentials")
|
|
||||||
sess.UseBool("read_only")
|
|
||||||
|
|
||||||
var updateSession *xorm.Session
|
var updateSession *xorm.Session
|
||||||
if cmd.Version != 0 {
|
if cmd.Version != 0 {
|
||||||
// the reason we allow cmd.version > db.version is make it possible for people to force
|
// the reason we allow cmd.version > db.version is make it possible for people to force
|
||||||
@ -190,7 +185,7 @@ func UpdateDataSource(cmd *m.UpdateDataSourceCommand) error {
|
|||||||
updateSession = sess.Where("id=? and org_id=?", ds.Id, ds.OrgId)
|
updateSession = sess.Where("id=? and org_id=?", ds.Id, ds.OrgId)
|
||||||
}
|
}
|
||||||
|
|
||||||
affected, err := updateSession.Update(ds)
|
affected, err := updateSession.AllCols().Omit("created").Update(ds)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user