mirror of
https://github.com/discourse/discourse.git
synced 2025-03-03 19:12:12 +08:00
Merge pull request #2072 from ligthyear/fix-edit-body-too-similar-issue
Be more liberal when users wants to change their own body to a previous version
This commit is contained in:
commit
dbb383497c
@ -101,12 +101,13 @@ class Post < ActiveRecord::Base
|
||||
|
||||
def store_unique_post_key
|
||||
if SiteSetting.unique_posts_mins > 0
|
||||
$redis.setex(unique_post_key, SiteSetting.unique_posts_mins.minutes.to_i, "1")
|
||||
$redis.setex(unique_post_key, SiteSetting.unique_posts_mins.minutes.to_i, id)
|
||||
end
|
||||
end
|
||||
|
||||
def matches_recent_post?
|
||||
$redis.exists(unique_post_key)
|
||||
post_id = $redis.get(unique_post_key)
|
||||
post_id != nil and post_id != id
|
||||
end
|
||||
|
||||
def raw_hash
|
||||
|
Loading…
x
Reference in New Issue
Block a user