[refs #579] dont create wrong comment

This commit is contained in:
Alexander Machehin 2012-10-08 21:31:30 +06:00
parent 3241b7a55a
commit 21b7b0d0b1
1 changed files with 3 additions and 2 deletions

View File

@ -9,8 +9,9 @@ class Projects::CommentsController < Projects::BaseController
include CommentsHelper
def create
res = set_additional_data
if @comment.save
if !set_additional_data
flash[:error] = I18n.t("flash.comment.save_error")
elsif @comment.save
flash[:notice] = I18n.t("flash.comment.saved")
else
flash[:error] = I18n.t("flash.comment.save_error")