mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
BUGFIX: staff can now edit delted posts
fixes #1343 This was way easier than mucking with the UI
This commit is contained in:
parent
6befdceabf
commit
eeb83adf71
@ -59,7 +59,9 @@ class PostsController < ApplicationController
|
|||||||
def update
|
def update
|
||||||
params.require(:post)
|
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?
|
post.image_sizes = params[:image_sizes] if params[:image_sizes].present?
|
||||||
guardian.ensure_can_edit!(post)
|
guardian.ensure_can_edit!(post)
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ class PostAlertObserver < ActiveRecord::Observer
|
|||||||
def after_create_post_revision(post_revision)
|
def after_create_post_revision(post_revision)
|
||||||
post = post_revision.post
|
post = post_revision.post
|
||||||
|
|
||||||
|
return unless post
|
||||||
return if post_revision.user.blank?
|
return if post_revision.user.blank?
|
||||||
return if post_revision.user_id == post.user_id
|
return if post_revision.user_id == post.user_id
|
||||||
return if post.topic.private_message?
|
return if post.topic.private_message?
|
||||||
|
Loading…
Reference in New Issue
Block a user