fix permission app error with updatePost (#6749)

Этот коммит содержится в:
Saturnino Abril
2017-06-27 04:05:50 +08:00
коммит произвёл George Goldberg
родитель ffaab0bf22
Коммит f2abb9d8eb
3 изменённых файлов: 6 добавлений и 5 удалений

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

@@ -302,6 +302,10 @@ func searchPosts(c *Context, w http.ResponseWriter, r *http.Request) {
func updatePost(c *Context, w http.ResponseWriter, r *http.Request) {
c.RequirePostId()
if c.Err != nil {
return
}
post := model.PostFromJson(r.Body)
if post == nil {

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

@@ -137,6 +137,8 @@ func TestUpdatePost(t *testing.T) {
msg := "zz" + model.NewId() + " update post"
rpost.Message = msg
rpost.UserId = ""
rupost, resp := Client.UpdatePost(rpost.Id, rpost)
CheckNoError(t, resp)