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:
Régis Hanol 2014-03-07 11:38:59 +01:00
commit dbb383497c
1 changed files with 3 additions and 2 deletions

View File

@ -101,12 +101,13 @@ class Post < ActiveRecord::Base
def store_unique_post_key def store_unique_post_key
if SiteSetting.unique_posts_mins > 0 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
end end
def matches_recent_post? def matches_recent_post?
$redis.exists(unique_post_key) post_id = $redis.get(unique_post_key)
post_id != nil and post_id != id
end end
def raw_hash def raw_hash