Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
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
4b620db0
authored
Feb 11, 2013
by
tarokkk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
one: Added quota cehck, school added owned shares
parent
2dea86ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
one/views.py
+3
-1
school/models.py
+3
-0
No files found.
one/views.py
View file @
4b620db0
...
@@ -210,7 +210,9 @@ def vm_new(request, template=None, share=None):
...
@@ -210,7 +210,9 @@ def vm_new(request, template=None, share=None):
t
.
save
()
t
.
save
()
base
=
t
base
=
t
try
:
try
:
i
=
Instance
.
submit
(
base
,
request
.
user
,
extra
=
"<RECONTEXT>YES</RECONTEXT>"
,
share
=
share
)
#Gány quota
if
share
==
None
or
(
share
!=
None
and
share
.
get_running
()
<
share
.
instance_limit
):
i
=
Instance
.
submit
(
base
,
request
.
user
,
extra
=
"<RECONTEXT>YES</RECONTEXT>"
,
share
=
share
)
return
redirect
(
i
)
return
redirect
(
i
)
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
error
(
'Failed to create virtual machine.'
+
unicode
(
e
))
logger
.
error
(
'Failed to create virtual machine.'
+
unicode
(
e
))
...
...
school/models.py
View file @
4b620db0
...
@@ -29,6 +29,9 @@ class Person(models.Model):
...
@@ -29,6 +29,9 @@ class Person(models.Model):
choices
=
LANGUAGE_CHOICES
,
default
=
LANGUAGE_CODE
)
choices
=
LANGUAGE_CHOICES
,
default
=
LANGUAGE_CODE
)
code
=
models
.
CharField
(
_
(
'code'
),
max_length
=
30
,
unique
=
True
)
code
=
models
.
CharField
(
_
(
'code'
),
max_length
=
30
,
unique
=
True
)
def
get_owned_shares
(
self
):
return
one
.
models
.
Share
.
objects
.
filter
(
group__in
=
self
.
owned_groups
.
all
())
def
get_shares
(
self
):
def
get_shares
(
self
):
return
one
.
models
.
Share
.
objects
.
filter
(
group__in
=
self
.
course_groups
.
all
())
return
one
.
models
.
Share
.
objects
.
filter
(
group__in
=
self
.
course_groups
.
all
())
...
...
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