Fixing websockets updates for promote/demote (#11799)

* Fixing websockets updates for promote/demote

* Adding extra test check

* Addressing PR comments
Этот коммит содержится в:
Jesús Espino
2019-08-16 08:39:34 +02:00
коммит произвёл GitHub
родитель 135acbb0b0
Коммит 83197ec5ff
3 изменённых файлов: 50 добавлений и 10 удалений

Просмотреть файл

@@ -1635,8 +1635,10 @@ func (us SqlUserStore) PromoteGuestToUser(userId string) *model.AppError {
}
}
curTime := model.GetMillis()
query := us.getQueryBuilder().Update("Users").
Set("Roles", strings.Join(roles, " ")).
Set("UpdateAt", curTime).
Where(sq.Eq{"Id": userId})
queryString, args, err := query.ToSql()
@@ -1705,8 +1707,10 @@ func (us SqlUserStore) DemoteUserToGuest(userId string) *model.AppError {
}
}
curTime := model.GetMillis()
query := us.getQueryBuilder().Update("Users").
Set("Roles", strings.Join(newRoles, " ")).
Set("UpdateAt", curTime).
Where(sq.Eq{"Id": userId})
queryString, args, err := query.ToSql()