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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
one/views.py
+2
-0
school/models.py
+3
-0
No files found.
one/views.py
View file @
4b620db0
...
...
@@ -210,6 +210,8 @@ def vm_new(request, template=None, share=None):
t
.
save
()
base
=
t
try
:
#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
)
except
Exception
as
e
:
...
...
school/models.py
View file @
4b620db0
...
...
@@ -29,6 +29,9 @@ class Person(models.Model):
choices
=
LANGUAGE_CHOICES
,
default
=
LANGUAGE_CODE
)
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
):
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