BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
464dddf4
Commit
464dddf4
authored
Dec 16, 2016
by
Lin Jen-Shin
Committed by
Clement Ho
Jan 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show no issues if author/assignee cannot be found
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7345/diffs#note_19994225
parent
866bb202
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
issuable_finder.rb
app/finders/issuable_finder.rb
+12
-8
No files found.
app/finders/issuable_finder.rb
View file @
464dddf4
...
...
@@ -178,7 +178,7 @@ class IssuableFinder
@assignee
=
if
assignee_id?
User
.
find
(
params
[
:assignee_id
])
User
.
find
_by
(
id:
params
[
:assignee_id
])
elsif
assignee_username?
User
.
find_by
(
username:
params
[
:assignee_username
])
else
...
...
@@ -198,9 +198,9 @@ class IssuableFinder
return
@author
if
defined?
(
@author
)
@author
=
if
author_id?
&&
params
[
:author_id
]
!=
NONE
User
.
find
(
params
[
:author_id
])
elsif
author_username?
&&
params
[
:author_username
]
!=
NONE
if
author_id?
User
.
find
_by
(
id:
params
[
:author_id
])
elsif
author_username?
User
.
find_by
(
username:
params
[
:author_username
])
else
nil
...
...
@@ -275,16 +275,20 @@ class IssuableFinder
end
def
by_assignee
(
items
)
if
assignee_id?
||
assignee_username?
items
=
items
.
where
(
assignee_id:
assignee
.
try
(
:id
))
if
assignee
items
=
items
.
where
(
assignee_id:
assignee
.
id
)
elsif
assignee_id?
||
assignee_username?
# assignee not found
items
=
items
.
none
end
items
end
def
by_author
(
items
)
if
author_id?
||
author_username?
items
=
items
.
where
(
author_id:
author
.
try
(
:id
))
if
author
items
=
items
.
where
(
author_id:
author
.
id
)
elsif
author_id?
||
author_username?
# author not found
items
=
items
.
none
end
items
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment