Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
21066e82
Commit
21066e82
authored
Aug 08, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pending delete projects no longer return 500 error in Admins projects view
parent
86f5a4aa
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
1 deletion
+23
-1
app/finders/admin/projects_finder.rb
app/finders/admin/projects_finder.rb
+1
-1
changelogs/unreleased/35435-pending-delete-project-error-in-admin-interface-fix.yml
...5-pending-delete-project-error-in-admin-interface-fix.yml
+4
-0
spec/controllers/admin/projects_controller_spec.rb
spec/controllers/admin/projects_controller_spec.rb
+12
-0
spec/finders/admin/projects_finder_spec.rb
spec/finders/admin/projects_finder_spec.rb
+6
-0
No files found.
app/finders/admin/projects_finder.rb
View file @
21066e82
...
@@ -18,7 +18,7 @@ class Admin::ProjectsFinder
...
@@ -18,7 +18,7 @@ class Admin::ProjectsFinder
end
end
def
execute
def
execute
items
=
Project
.
with_statistics
items
=
Project
.
with
out_deleted
.
with
_statistics
items
=
items
.
in_namespace
(
namespace_id
)
if
namespace_id
.
present?
items
=
items
.
in_namespace
(
namespace_id
)
if
namespace_id
.
present?
items
=
items
.
where
(
visibility_level:
visibility_level
)
if
visibility_level
.
present?
items
=
items
.
where
(
visibility_level:
visibility_level
)
if
visibility_level
.
present?
items
=
items
.
with_push
if
with_push
.
present?
items
=
items
.
with_push
if
with_push
.
present?
...
...
changelogs/unreleased/35435-pending-delete-project-error-in-admin-interface-fix.yml
0 → 100644
View file @
21066e82
---
title
:
Project pending delete no longer return 500 error in admins projects view
merge_request
:
13389
author
:
spec/controllers/admin/projects_controller_spec.rb
View file @
21066e82
...
@@ -12,12 +12,24 @@ describe Admin::ProjectsController do
...
@@ -12,12 +12,24 @@ describe Admin::ProjectsController do
it
'retrieves the project for the given visibility level'
do
it
'retrieves the project for the given visibility level'
do
get
:index
,
visibility_level:
[
Gitlab
::
VisibilityLevel
::
PUBLIC
]
get
:index
,
visibility_level:
[
Gitlab
::
VisibilityLevel
::
PUBLIC
]
expect
(
response
.
body
).
to
match
(
project
.
name
)
expect
(
response
.
body
).
to
match
(
project
.
name
)
end
end
it
'does not retrieve the project'
do
it
'does not retrieve the project'
do
get
:index
,
visibility_level:
[
Gitlab
::
VisibilityLevel
::
INTERNAL
]
get
:index
,
visibility_level:
[
Gitlab
::
VisibilityLevel
::
INTERNAL
]
expect
(
response
.
body
).
not_to
match
(
project
.
name
)
expect
(
response
.
body
).
not_to
match
(
project
.
name
)
end
end
it
'does not respond with projects pending deletion'
do
pending_delete_project
=
create
(
:project
,
pending_delete:
true
)
get
:index
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
.
body
).
not_to
match
(
pending_delete_project
.
name
)
expect
(
response
.
body
).
to
match
(
project
.
name
)
end
end
end
end
end
spec/finders/admin/projects_finder_spec.rb
View file @
21066e82
...
@@ -38,6 +38,12 @@ describe Admin::ProjectsFinder do
...
@@ -38,6 +38,12 @@ describe Admin::ProjectsFinder do
it
{
is_expected
.
to
match_array
([
shared_project
,
public_project
,
internal_project
,
private_project
])
}
it
{
is_expected
.
to
match_array
([
shared_project
,
public_project
,
internal_project
,
private_project
])
}
end
end
context
'with pending delete project'
do
let!
(
:pending_delete_project
)
{
create
(
:project
,
pending_delete:
true
)
}
it
{
is_expected
.
not_to
include
(
pending_delete_project
)
}
end
context
'filter by namespace_id'
do
context
'filter by namespace_id'
do
let
(
:namespace
)
{
create
(
:namespace
)
}
let
(
:namespace
)
{
create
(
:namespace
)
}
let!
(
:project_in_namespace
)
{
create
(
:project
,
namespace:
namespace
)
}
let!
(
:project_in_namespace
)
{
create
(
:project
,
namespace:
namespace
)
}
...
...
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