فهرست منبع

Merge pull request #15608 from Maddin-619/fix-datasource-update

Fix Datasource Update to no User/Password
Carl Bergquist 6 سال پیش
والد
کامیت
71bfefa8fb
1فایلهای تغییر یافته به همراه1 افزوده شده و 6 حذف شده
  1. 1 6
      pkg/services/sqlstore/datasource.go

+ 1 - 6
pkg/services/sqlstore/datasource.go

@@ -174,11 +174,6 @@ func UpdateDataSource(cmd *m.UpdateDataSourceCommand) error {
 			Version:           cmd.Version + 1,
 		}
 
-		sess.UseBool("is_default")
-		sess.UseBool("basic_auth")
-		sess.UseBool("with_credentials")
-		sess.UseBool("read_only")
-
 		var updateSession *xorm.Session
 		if cmd.Version != 0 {
 			// 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)
 		}
 
-		affected, err := updateSession.Update(ds)
+		affected, err := updateSession.AllCols().Omit("created").Update(ds)
 		if err != nil {
 			return err
 		}