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
22d53f06
Commit
22d53f06
authored
Jul 25, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes 500 error caused by pending delete projects in admin dashboard
parent
ea6dfcad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
app/controllers/admin/dashboard_controller.rb
app/controllers/admin/dashboard_controller.rb
+1
-1
changelogs/unreleased/35453-pending-delete-projects-error-in-admin-dashboard-fix.yml
...-pending-delete-projects-error-in-admin-dashboard-fix.yml
+4
-0
spec/controllers/admin/dashboard_controller_spec.rb
spec/controllers/admin/dashboard_controller_spec.rb
+21
-0
No files found.
app/controllers/admin/dashboard_controller.rb
View file @
22d53f06
class
Admin::DashboardController
<
Admin
::
ApplicationController
class
Admin::DashboardController
<
Admin
::
ApplicationController
def
index
def
index
@projects
=
Project
.
with_route
.
limit
(
10
)
@projects
=
Project
.
with
out_deleted
.
with
_route
.
limit
(
10
)
@users
=
User
.
limit
(
10
)
@users
=
User
.
limit
(
10
)
@groups
=
Group
.
with_route
.
limit
(
10
)
@groups
=
Group
.
with_route
.
limit
(
10
)
end
end
...
...
changelogs/unreleased/35453-pending-delete-projects-error-in-admin-dashboard-fix.yml
0 → 100644
View file @
22d53f06
---
title
:
Fixes 500 error caused by pending delete projects in admin dashboard
merge_request
:
13067
author
:
spec/controllers/admin/dashboard_controller_spec.rb
0 → 100644
View file @
22d53f06
require
'spec_helper'
describe
Admin
::
DashboardController
do
describe
'#index'
do
context
'with pending_delete projects'
do
render_views
it
'does not retrieve projects that are pending deletion'
do
sign_in
(
create
(
:admin
))
project
=
create
(
:project
)
pending_delete_project
=
create
(
:project
,
pending_delete:
true
)
get
:index
expect
(
response
.
body
).
to
match
(
project
.
name
)
expect
(
response
.
body
).
not_to
match
(
pending_delete_project
.
name
)
end
end
end
end
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