mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
FIX: Actually error when topic timer time is in the past (#11434)
This commit is contained in:

committed by
GitHub

parent
b824af02d4
commit
9f786306bd
@ -1339,10 +1339,9 @@ class Topic < ActiveRecord::Base
|
||||
topic_timer.execute_at = num_hours.hours.from_now if num_hours > 0
|
||||
else
|
||||
timestamp = utc.parse(time)
|
||||
raise Discourse::InvalidParameters unless timestamp
|
||||
raise Discourse::InvalidParameters unless timestamp && timestamp > utc.now
|
||||
# a timestamp in client's time zone, like "2015-5-27 12:00"
|
||||
topic_timer.execute_at = timestamp
|
||||
topic_timer.errors.add(:execute_at, :invalid) if timestamp < utc.now
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user