Avoid calling can_delete_account twice

This commit is contained in:
Neil Lalonde 2014-02-13 15:51:19 -05:00
parent feb4fa3bb5
commit 42fb9d4fb1
2 changed files with 5 additions and 5 deletions

View File

@ -56,11 +56,11 @@ class CurrentUserSerializer < BasicUserSerializer
end
def include_can_delete_account?
can_delete_account
end
def can_delete_account
scope.can_delete_user?(object)
end
def can_delete_account
true
end
end

View File

@ -25,7 +25,7 @@ class UserDestroyer
end
end
end
x = PostDestroyer.new(@actor.staff? ? @actor : Discourse.system_user, post).destroy
PostDestroyer.new(@actor.staff? ? @actor : Discourse.system_user, post).destroy
if post.topic and post.post_number == 1
Topic.unscoped.where(id: post.topic.id).update_all(user_id: nil)
end