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
c11cf23e
authored
Jul 11, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: allow creating templates only with lease operators
parent
c1b159b9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
circle/dashboard/forms.py
+3
-0
circle/vm/models/common.py
+1
-0
No files found.
circle/dashboard/forms.py
View file @
c11cf23e
...
...
@@ -612,6 +612,9 @@ class TemplateForm(forms.ModelForm):
self
.
instance
.
ram_size
=
512
self
.
instance
.
num_cores
=
2
self
.
fields
[
"lease"
]
.
queryset
=
Lease
.
get_objects_with_level
(
"operator"
,
self
.
user
)
def
clean_owner
(
self
):
if
self
.
instance
.
pk
is
not
None
:
return
User
.
objects
.
get
(
pk
=
self
.
instance
.
owner
.
pk
)
...
...
circle/vm/models/common.py
View file @
c11cf23e
...
...
@@ -77,6 +77,7 @@ class Lease(AclBase):
"""
ACL_LEVELS
=
(
(
'user'
,
_
(
'user'
)),
# use this lease
(
'operator'
,
_
(
'operator'
)),
# share this lease
(
'owner'
,
_
(
'owner'
)),
# change this lease
)
name
=
CharField
(
max_length
=
100
,
unique
=
True
,
...
...
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