diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-09-24 09:48:19 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-09-24 09:48:19 +0100 |
commit | 54281fd50c3271835a54ab4bc08d40da09d643ee (patch) | |
tree | 6e73e90303e0d7cab3379d7a78a2299b79219f1a /app/controllers/comment_controller.rb | |
parent | 793ca358c37458e6cc4385d2366621aaee93a25e (diff) | |
parent | de8bc5b736828f0670c7259f1c4036bb97621cd3 (diff) |
Merge remote-tracking branch 'henare_github/patch-1'
Diffstat (limited to 'app/controllers/comment_controller.rb')
-rw-r--r-- | app/controllers/comment_controller.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb index 1552017c2..988a8a6f8 100644 --- a/app/controllers/comment_controller.rb +++ b/app/controllers/comment_controller.rb @@ -23,6 +23,13 @@ class CommentController < ApplicationController else raise "Unknown type " + params[:type] end + + # Are comments disabled on this request? + # + # There is no “add comment” link when comments are disabled, so users should + # not usually hit this unless they are explicitly attempting to avoid the comment + # block, so we just raise an exception. + raise "Comments are not allowed on this request" if !@info_request.comments_allowed? # Banned from adding comments? if !authenticated_user.nil? && !authenticated_user.can_make_comments? |