mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05: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
1 changed files with 3 additions and 2 deletions
|
@ -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…
Reference in a new issue