summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2014-01-21 22:30:55 +0100
committerAlex Legler <alex@a3li.li>2014-01-21 22:30:55 +0100
commit16990b037e37b15f201da487d444a0af7182b51f (patch)
tree72b11008e28ad81723cfb7fb17879a09b0f7fa71
parentglsa_helper: Fix word_wrap invocation for rails 4 (diff)
downloadglsamaker-16990b037e37b15f201da487d444a0af7182b51f.tar.gz
glsamaker-16990b037e37b15f201da487d444a0af7182b51f.tar.bz2
glsamaker-16990b037e37b15f201da487d444a0af7182b51f.zip
Comment: Disallow approvals of non-filled in drafts
-rw-r--r--app/models/comment.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/comment.rb b/app/models/comment.rb
index ff9f7b8..fa285a4 100644
--- a/app/models/comment.rb
+++ b/app/models/comment.rb
@@ -28,6 +28,10 @@ class Comment < ActiveRecord::Base
end
end
+ if record.glsa.submitter.nil?
+ record.errors[:rating] << 'You may not approve or reject advisories that have not been filled in yet'
+ end
+
if record.user.access < 2
if record.rating != 'neutral'
record.errors[:rating] << 'You may not approve or reject drafts'