FEATURE: New post editing period for >= tl2 users (#8070)

* FEATURE: Add tl2 threshold for editing new posts

* Adds a new setting and for tl2 editing posts (30 days same as old value)
* Sets the tl0/tl1 editing period as 1 day

* FIX: Spec uses wrong setting

* Fix site setting on guardian spec

* FIX: post editing period specs

* Avoid shared examples
* Use update_columns to avoid callbacks on user during tests
This commit is contained in:
Rimian Perkins
2019-09-06 21:44:12 +10:00
committed by Robin Ward
parent 103629d257
commit 6bbd83067d
8 changed files with 95 additions and 29 deletions

View File

@ -204,7 +204,7 @@ class PostsController < ApplicationController
if !guardian.public_send("can_edit?", post) &&
post.user_id == current_user.id &&
post.edit_time_limit_expired?
post.edit_time_limit_expired?(current_user)
return render_json_error(I18n.t('too_late_to_edit'))
end