mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 02:23:44 +08:00
FIX: Change post owner of deleted post, take 3
This commit is contained in:
parent
46c8d0d7e2
commit
acbf82d8db
|
@ -16,7 +16,6 @@ class PostOwnerChanger
|
||||||
@topic.user = @new_owner if post.is_first_post?
|
@topic.user = @new_owner if post.is_first_post?
|
||||||
|
|
||||||
if post.user == nil
|
if post.user == nil
|
||||||
post.recover!
|
|
||||||
@topic.recover! if post.is_first_post?
|
@topic.recover! if post.is_first_post?
|
||||||
end
|
end
|
||||||
post.topic = @topic
|
post.topic = @topic
|
||||||
|
|
|
@ -258,7 +258,6 @@ describe TopicsController do
|
||||||
t2.reload
|
t2.reload
|
||||||
p3.reload
|
p3.reload
|
||||||
expect(t2.deleted_at).to be_nil
|
expect(t2.deleted_at).to be_nil
|
||||||
expect(p3.deleted_at).to be_nil
|
|
||||||
expect(p3.user).to eq(user_a)
|
expect(p3.user).to eq(user_a)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user