Commit 866bb202 authored by Lin Jen-Shin's avatar Lin Jen-Shin Committed by Clement Ho

Check if it's not NONE too

So that we don't have to check it again in somewhere else,
and we don't really need to know if it's presented as NONE

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7345/diffs#note_20123999
parent b0d8d742
......@@ -166,20 +166,20 @@ class IssuableFinder
end
def assignee_id?
params[:assignee_id].present?
params[:assignee_id].present? && params[:assignee_id] != NONE
end
def assignee_username?
params[:assignee_username].present?
params[:assignee_username].present? && params[:assignee_username] != NONE
end
def assignee
return @assignee if defined?(@assignee)
@assignee =
if assignee_id? && params[:assignee_id] != NONE
if assignee_id?
User.find(params[:assignee_id])
elsif assignee_username? && params[:assignee_username] != NONE
elsif assignee_username?
User.find_by(username: params[:assignee_username])
else
nil
......@@ -187,11 +187,11 @@ class IssuableFinder
end
def author_id?
params[:author_id].present?
params[:author_id].present? && params[:author_id] != NONE
end
def author_username?
params[:author_username].present?
params[:author_username].present? && params[:author_username] != NONE
end
def author
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment