mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 05:25:16 -05:00
user where as opposed to find to compensate for deleted topics
This commit is contained in:
@@ -2,9 +2,9 @@ module Jobs
|
||||
class CloseTopic < Jobs::Base
|
||||
|
||||
def execute(args)
|
||||
topic = Topic.find(args[:topic_id])
|
||||
topic = Topic.where(id: args[:topic_id]).first
|
||||
if topic and topic.auto_close_at and !topic.closed? and !topic.deleted_at
|
||||
closer = User.find(args[:user_id])
|
||||
closer = User.where(id: args[:user_id]).first
|
||||
if Guardian.new(closer).can_moderate?(topic)
|
||||
topic.update_status('autoclosed', true, closer)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user