summaryrefslogtreecommitdiffstats
path: root/store
diff options
context:
space:
mode:
authorPark Daesun <yume@yumes.net>2016-05-03 03:08:48 +0900
committerCorey Hulen <corey@hulen.com>2016-05-02 11:08:48 -0700
commite3f254c3be26aa05730afc46f5584bb595eea232 (patch)
tree49c929fb00a304c1b2ef346b370ca060f9765523 /store
parentddc888d264dee67504d2242f1cf705fb62ed3b22 (diff)
downloadchat-e3f254c3be26aa05730afc46f5584bb595eea232.tar.gz
chat-e3f254c3be26aa05730afc46f5584bb595eea232.tar.bz2
chat-e3f254c3be26aa05730afc46f5584bb595eea232.zip
Fix the EmailVerified column value from '1' to true (#2843)
EmailVerified column type is bool. but these queries were a string type and a number type. this is ok in Mysql but cause errors in Postgresql. like this(user_test.go:970). ``` [2016/05/02 23:20:47 KST] [EROR] /api/v3/users/reset_password:SqlUserStore.UpdatePassword code=500 rid=ezj4agkewibjzni3ptybq5knbh uid=9z53qbkxj7nq9m8r8jbb47enzr ip=::1 We couldn't update the user password [details: id=8bymugax77yhfff9zj4frthapc, pq: column "emailverified" is of type boolean but expression is of type integer] --- FAIL: TestResetPassword (0.90s) user_test.go:970: : We couldn't update the user password, id=8bymugax77yhfff9zj4frthapc, pq: column "emailverified" is of type boolean but expression is of type integer ```
Diffstat (limited to 'store')
-rw-r--r--store/sql_user_store.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go
index 9db378341..4d18aabd1 100644
--- a/store/sql_user_store.go
+++ b/store/sql_user_store.go
@@ -265,7 +265,7 @@ func (us SqlUserStore) UpdatePassword(userId, hashedPassword string) StoreChanne
updateAt := model.GetMillis()
- if _, err := us.GetMaster().Exec("UPDATE Users SET Password = :Password, LastPasswordUpdate = :LastPasswordUpdate, UpdateAt = :UpdateAt, AuthData = '', AuthService = '', EmailVerified = 1, FailedAttempts = 0 WHERE Id = :UserId", map[string]interface{}{"Password": hashedPassword, "LastPasswordUpdate": updateAt, "UpdateAt": updateAt, "UserId": userId}); err != nil {
+ if _, err := us.GetMaster().Exec("UPDATE Users SET Password = :Password, LastPasswordUpdate = :LastPasswordUpdate, UpdateAt = :UpdateAt, AuthData = '', AuthService = '', EmailVerified = true, FailedAttempts = 0 WHERE Id = :UserId", map[string]interface{}{"Password": hashedPassword, "LastPasswordUpdate": updateAt, "UpdateAt": updateAt, "UserId": userId}); err != nil {
result.Err = model.NewLocAppError("SqlUserStore.UpdatePassword", "store.sql_user.update_password.app_error", nil, "id="+userId+", "+err.Error())
} else {
result.Data = userId
@@ -722,7 +722,7 @@ func (us SqlUserStore) VerifyEmail(userId string) StoreChannel {
go func() {
result := StoreResult{}
- if _, err := us.GetMaster().Exec("UPDATE Users SET EmailVerified = '1' WHERE Id = :UserId", map[string]interface{}{"UserId": userId}); err != nil {
+ if _, err := us.GetMaster().Exec("UPDATE Users SET EmailVerified = true WHERE Id = :UserId", map[string]interface{}{"UserId": userId}); err != nil {
result.Err = model.NewLocAppError("SqlUserStore.VerifyEmail", "store.sql_user.verify_email.app_error", nil, "userId="+userId+", "+err.Error())
}