FIX: don't let blocked users reach post creator or new post queue

correct broken spec
This commit is contained in:
Sam
2015-08-06 10:32:53 +10:00
parent 11d39345b3
commit bafdf9290d
2 changed files with 11 additions and 0 deletions

View File

@ -88,6 +88,15 @@ class PostsController < ApplicationController
end
def create
if !is_api? && current_user.blocked?
# error has parity with what user would get if they posted when blocked
# and it went through post creator
render json: {errors: [I18n.t("topic_not_found")]}, status: 422
return
end
@manager_params = create_params
@manager_params[:first_post_checks] = !is_api?