Skip to content

Commit

Permalink
BUGFIX: staff can now edit delted posts
Browse files Browse the repository at this point in the history
fixes #1343

This was way easier than mucking with the UI
  • Loading branch information
SamSaffron committed Jan 6, 2014
1 parent 6befdce commit eeb83ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/posts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def create
def update
params.require(:post)

post = Post.where(id: params[:id]).first
post = Post.where(id: params[:id])
post = post.with_deleted if guardian.is_staff?
post = post.first
post.image_sizes = params[:image_sizes] if params[:image_sizes].present?
guardian.ensure_can_edit!(post)

Expand Down
1 change: 1 addition & 0 deletions app/models/post_alert_observer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def after_create_post_action(post_action)
def after_create_post_revision(post_revision)
post = post_revision.post

return unless post
return if post_revision.user.blank?
return if post_revision.user_id == post.user_id
return if post.topic.private_message?
Expand Down

0 comments on commit eeb83ad

Please sign in to comment.