mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Can't update status_type of topic timers.
https://meta.discourse.org/t/topic-timers-internal-error-500/64805
This commit is contained in:
@@ -988,9 +988,10 @@ SQL
|
||||
# * based_on_last_post: True if time should be based on timestamp of the last post.
|
||||
# * category_id: Category that the update will apply to.
|
||||
def set_or_create_timer(status_type, time, by_user: nil, timezone_offset: 0, based_on_last_post: false, category_id: SiteSetting.uncategorized_category_id)
|
||||
topic_timer_options = { status_type: status_type, topic: self }
|
||||
topic_timer_options = { topic: self }
|
||||
topic_timer_options.merge!(user: by_user) unless TopicTimer.public_types[status_type]
|
||||
topic_timer = TopicTimer.find_or_initialize_by(topic_timer_options)
|
||||
topic_timer.status_type = status_type
|
||||
|
||||
if time.blank?
|
||||
topic_timer.trash!(trashed_by: by_user || Discourse.system_user)
|
||||
|
||||
Reference in New Issue
Block a user