Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
91f6d6df
authored
Feb 25, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: dont count deleted vms (fixes #68)
parent
ab21b946
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
one/views.py
+3
-1
No files found.
one/views.py
View file @
91f6d6df
...
@@ -33,11 +33,13 @@ def _list_instances(request):
...
@@ -33,11 +33,13 @@ def _list_instances(request):
instances
=
Instance
.
objects
.
exclude
(
state
=
'DONE'
)
.
filter
(
owner
=
request
.
user
)
instances
=
Instance
.
objects
.
exclude
(
state
=
'DONE'
)
.
filter
(
owner
=
request
.
user
)
for
i
in
instances
:
for
i
in
instances
:
i
.
update_state
()
i
.
update_state
()
instances
=
instances
.
exclude
(
state
=
'DONE'
)
return
instances
return
instances
@require_GET
@require_GET
@login_required
@login_required
def
home
(
request
):
def
home
(
request
):
instances
=
_list_instances
(
request
)
shares
=
[
s
for
s
in
request
.
user
.
person_set
.
all
()[
0
]
.
get_shares
()]
shares
=
[
s
for
s
in
request
.
user
.
person_set
.
all
()[
0
]
.
get_shares
()]
for
i
,
s
in
enumerate
(
shares
):
for
i
,
s
in
enumerate
(
shares
):
s
.
running_shared
=
s
.
instance_set
.
all
()
.
exclude
(
state
=
"DONE"
)
.
filter
(
owner
=
request
.
user
)
.
count
()
s
.
running_shared
=
s
.
instance_set
.
all
()
.
exclude
(
state
=
"DONE"
)
.
filter
(
owner
=
request
.
user
)
.
count
()
...
@@ -52,10 +54,10 @@ def home(request):
...
@@ -52,10 +54,10 @@ def home(request):
except
:
except
:
generated_public_key
=
-
1
generated_public_key
=
-
1
return
render_to_response
(
"home.html"
,
RequestContext
(
request
,
{
return
render_to_response
(
"home.html"
,
RequestContext
(
request
,
{
'instances'
:
instances
,
'shares'
:
shares
,
'shares'
:
shares
,
'templates'
:
Template
.
objects
.
filter
(
state
=
'READY'
),
'templates'
:
Template
.
objects
.
filter
(
state
=
'READY'
),
'mytemplates'
:
Template
.
objects
.
filter
(
owner
=
request
.
user
),
'mytemplates'
:
Template
.
objects
.
filter
(
owner
=
request
.
user
),
'instances'
:
_list_instances
(
request
),
'groups'
:
request
.
user
.
person_set
.
all
()[
0
]
.
owned_groups
.
all
(),
'groups'
:
request
.
user
.
person_set
.
all
()[
0
]
.
owned_groups
.
all
(),
'semesters'
:
Semester
.
objects
.
all
(),
'semesters'
:
Semester
.
objects
.
all
(),
'userdetails'
:
details
,
'userdetails'
:
details
,
...
...
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