BigW Consortium Gitlab

Commit f739a4e8 by Grzegorz Bizon Committed by Robert Speicher

Remove reduntant note validation from create service

parent 1bcb1ef8
...@@ -5,8 +5,6 @@ module Notes ...@@ -5,8 +5,6 @@ module Notes
note.author = current_user note.author = current_user
note.system = false note.system = false
return unless valid_project?(note)
if note.save if note.save
# Finish the harder work in the background # Finish the harder work in the background
NewNoteWorker.perform_in(2.seconds, note.id, params) NewNoteWorker.perform_in(2.seconds, note.id, params)
...@@ -15,14 +13,5 @@ module Notes ...@@ -15,14 +13,5 @@ module Notes
note note
end end
private
def valid_project?(note)
return false unless project
return true if note.for_commit?
note.noteable.try(:project) == project
end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment