loading a user in a post_action is wasteful
This commit is contained in:
parent
3da1104ec3
commit
ec948dc660
|
@ -281,7 +281,8 @@ class Guardian
|
||||||
def can_delete_post_action?(post_action)
|
def can_delete_post_action?(post_action)
|
||||||
|
|
||||||
# You can only undo your own actions
|
# You can only undo your own actions
|
||||||
return false unless post_action.user == @user
|
return false unless @user
|
||||||
|
return false unless post_action.user_id == @user.id
|
||||||
|
|
||||||
# Make sure they want to delete it within the window
|
# Make sure they want to delete it within the window
|
||||||
return post_action.created_at > SiteSetting.post_undo_action_window_mins.minutes.ago
|
return post_action.created_at > SiteSetting.post_undo_action_window_mins.minutes.ago
|
||||||
|
|
Loading…
Reference in New Issue