BUGFIX: staff can now edit delted posts

fixes #1343

This was way easier than mucking with the UI
This commit is contained in:
Sam
2014-01-06 18:12:51 +11:00
parent 6befdceabf
commit eeb83adf71
2 changed files with 4 additions and 1 deletions

View File

@@ -59,7 +59,9 @@ class PostsController < ApplicationController
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)