summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorbarthc <mackintosh02@gmail.com>2016-09-27 15:24:50 +0100
committerRémy Coutable <remy@rymai.me>2016-10-24 15:24:56 +0200
commitea6c5c1c0ee8f09fff4dbf02d7bfb65107020996 (patch)
tree93cf97cc4ef0ab730cf8e4a8a850e74707682521 /app
parent1a7ba2a5e8603222b51a9e9cf0ffcde68cf593d2 (diff)
downloadgitlab-ce-ea6c5c1c0ee8f09fff4dbf02d7bfb65107020996.tar.gz
Fix authored vote from notes
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app')
-rw-r--r--app/services/notes/create_service.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb
index a36008c3ef5..723cc0e6834 100644
--- a/app/services/notes/create_service.rb
+++ b/app/services/notes/create_service.rb
@@ -7,8 +7,10 @@ module Notes
if note.award_emoji?
noteable = note.noteable
- todo_service.new_award_emoji(noteable, current_user)
- return noteable.create_award_emoji(note.award_emoji_name, current_user)
+ if noteable.user_can_award?(current_user, note.award_emoji_name)
+ todo_service.new_award_emoji(noteable, current_user)
+ return noteable.create_award_emoji(note.award_emoji_name, current_user)
+ end
end
# We execute commands (extracted from `params[:note]`) on the noteable