Fix not being able to see list of your own flags

fixes #2535
This commit is contained in:
Toks
2015-10-12 10:05:23 -04:00
parent 2fc5a28a8b
commit aa936a1cac

View File

@@ -50,7 +50,7 @@ class PostFlag < ActiveRecord::Base
q = q.where("creator_id = ?", params[:creator_id].to_i)
end
if params[:creator_name].present? && CurrentUser.is_moderator?
if params[:creator_name].present? && (CurrentUser.is_moderator? || params[:creator_name].mb_chars.downcase.strip.tr(" ", "_") == CurrentUser.user.name.downcase)
q = q.where("creator_id = (select _.id from users _ where lower(_.name) = ?)", params[:creator_name].mb_chars.downcase.strip.tr(" ", "_"))
end