Make CloseTopic a no-op just in case
This commit is contained in:
parent
24e1892d28
commit
c2bf525a06
|
@ -1,19 +1,11 @@
|
||||||
# This file is back temporarily to handle jobs that are enqueued
|
|
||||||
# far in the future that haven't been migrated to the ToggleTopicClosed
|
|
||||||
# job.
|
|
||||||
|
|
||||||
module Jobs
|
module Jobs
|
||||||
class CloseTopic < Jobs::Base
|
class CloseTopic < Jobs::Base
|
||||||
|
|
||||||
def execute(args)
|
def execute(args)
|
||||||
if topic = Topic.find_by(id: args[:topic_id])
|
# This file is back temporarily to handle jobs that are enqueued
|
||||||
closer = User.find_by(id: args[:user_id])
|
# far in the future that haven't been migrated to the ToggleTopicClosed
|
||||||
guardian = Guardian.new(closer)
|
# job.
|
||||||
unless guardian.can_close?(topic)
|
|
||||||
closer = Discourse.system_user
|
|
||||||
end
|
|
||||||
topic.auto_close(closer)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue