mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FIX: Topic view breaks with topic timer to publish to restricted category. (#16385)
When a user views a topic that contains a topic timer to publish to a restricted category, an error occurs on the client side because the user does not have access to information about the category. This commit fixes it such that the topic timer is not shown to the user if the user does not have access to the category.
This commit is contained in:

committed by
GitHub

parent
36dcf80aff
commit
0328757ffb
@ -112,6 +112,10 @@ class TopicTimer < ActiveRecord::Base
|
||||
true
|
||||
end
|
||||
|
||||
def publishing_to_category?
|
||||
self.status_type.to_i == TopicTimer.types[:publish_to_category]
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def duration_in_range?
|
||||
@ -138,10 +142,6 @@ class TopicTimer < ActiveRecord::Base
|
||||
))
|
||||
end
|
||||
|
||||
def publishing_to_category?
|
||||
self.status_type.to_i == TopicTimer.types[:publish_to_category]
|
||||
end
|
||||
|
||||
def schedule_auto_delete_replies_job
|
||||
Jobs.enqueue(TopicTimer.type_job_map[:delete_replies], topic_timer_id: id)
|
||||
end
|
||||
|
Reference in New Issue
Block a user