diff options
author | Alex Legler <alex@a3li.li> | 2014-01-21 22:30:55 +0100 |
---|---|---|
committer | Alex Legler <alex@a3li.li> | 2014-01-21 22:30:55 +0100 |
commit | 16990b037e37b15f201da487d444a0af7182b51f (patch) | |
tree | 72b11008e28ad81723cfb7fb17879a09b0f7fa71 | |
parent | glsa_helper: Fix word_wrap invocation for rails 4 (diff) | |
download | glsamaker-16990b037e37b15f201da487d444a0af7182b51f.tar.gz glsamaker-16990b037e37b15f201da487d444a0af7182b51f.tar.bz2 glsamaker-16990b037e37b15f201da487d444a0af7182b51f.zip |
Comment: Disallow approvals of non-filled in drafts
-rw-r--r-- | app/models/comment.rb | 4 |
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' |