mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
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:

committed by
Robin Ward

parent
103629d257
commit
6bbd83067d
@ -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
|
||||
|
Reference in New Issue
Block a user