mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Incorrect arguments were being passed to Jobs::ClosePoll.
Also fix spec that wasn't testing anything.
This commit is contained in:
@@ -3,7 +3,19 @@ module Jobs
|
||||
class ClosePoll < Jobs::Base
|
||||
|
||||
def execute(args)
|
||||
DiscoursePoll::Poll.toggle_status(args[:post_id], args[:poll_name], "closed", Discourse.system_user)
|
||||
%i{
|
||||
post_id
|
||||
poll_name
|
||||
}.each do |key|
|
||||
raise Discourse::InvalidParameters.new(key) if args[key].blank?
|
||||
end
|
||||
|
||||
DiscoursePoll::Poll.toggle_status(
|
||||
args[:post_id],
|
||||
args[:poll_name],
|
||||
"closed",
|
||||
Discourse.system_user
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user