diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2017-09-15 11:23:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-15 11:23:48 +0800 |
commit | 0f9e20b3d7a2c5f53cbf8d66e573b983288d06e0 (patch) | |
tree | d8e092253678abed9923232923dba8f60ad36125 /vendor/github.com | |
parent | e5d80b7090d7c1088854e8a0f8223bdf8a769d12 (diff) | |
download | gitea-0f9e20b3d7a2c5f53cbf8d66e573b983288d06e0.tar.gz gitea-0f9e20b3d7a2c5f53cbf8d66e573b983288d06e0.zip |
fix updated update on public key (#2514)
* fix updated update on public key
* update vendor.json
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* fix root path
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Diffstat (limited to 'vendor/github.com')
-rw-r--r-- | vendor/github.com/go-xorm/xorm/session_update.go | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/vendor/github.com/go-xorm/xorm/session_update.go b/vendor/github.com/go-xorm/xorm/session_update.go index 6e9d11681c..4e0f656db3 100644 --- a/vendor/github.com/go-xorm/xorm/session_update.go +++ b/vendor/github.com/go-xorm/xorm/session_update.go @@ -202,17 +202,19 @@ func (session *Session) Update(bean interface{}, condiBean ...interface{}) (int6 table := session.statement.RefTable if session.statement.UseAutoTime && table != nil && table.Updated != "" { - colNames = append(colNames, session.engine.Quote(table.Updated)+" = ?") - col := table.UpdatedColumn() - val, t := session.engine.NowTime2(col.SQLType.Name) - args = append(args, val) - - var colName = col.Name - if isStruct { - session.afterClosures = append(session.afterClosures, func(bean interface{}) { - col := table.GetColumn(colName) - setColumnTime(bean, col, t) - }) + if _, ok := session.statement.columnMap[strings.ToLower(table.Updated)]; !ok { + colNames = append(colNames, session.engine.Quote(table.Updated)+" = ?") + col := table.UpdatedColumn() + val, t := session.engine.NowTime2(col.SQLType.Name) + args = append(args, val) + + var colName = col.Name + if isStruct { + session.afterClosures = append(session.afterClosures, func(bean interface{}) { + col := table.GetColumn(colName) + setColumnTime(bean, col, t) + }) + } } } |