Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
28ee3823
authored
Jun 25, 2018
by
Szabolcs Gelencser
Committed by
Szabolcs Gelencsér
Jun 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract role listing to settings.py
parent
9ccc63cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
circle/circle/settings/base.py
+7
-0
circle/dashboard/forms.py
+1
-1
circle/dashboard/views/template.py
+2
-2
No files found.
circle/circle/settings/base.py
View file @
28ee3823
...
@@ -618,3 +618,10 @@ DEFAULT_LEASE_DELETE_SECONDS = 7200
...
@@ -618,3 +618,10 @@ DEFAULT_LEASE_DELETE_SECONDS = 7200
SESSIONHOOK_SHARED_SECRET
=
"verysecretmuchsecure"
SESSIONHOOK_SHARED_SECRET
=
"verysecretmuchsecure"
IS_NET_OMISSION_SUPPORTED
=
False
# in mitaka you must specify network at vm creation
IS_NET_OMISSION_SUPPORTED
=
False
# in mitaka you must specify network at vm creation
ROLES_SHOWN
=
[
"_member_"
,
"circle_admin"
,
"developer"
,
"researcher"
,
]
circle/dashboard/forms.py
View file @
28ee3823
...
@@ -580,7 +580,7 @@ class LeaseForm(forms.ModelForm):
...
@@ -580,7 +580,7 @@ class LeaseForm(forms.ModelForm):
if
roles
:
if
roles
:
self
.
fields
[
'roles'
]
.
choices
=
(
self
.
fields
[
'roles'
]
.
choices
=
(
(
role
.
name
,
role
.
nam
e
)
for
role
in
roles
(
role
,
rol
e
)
for
role
in
roles
)
)
if
self
.
instance
.
id
:
if
self
.
instance
.
id
:
...
...
circle/dashboard/views/template.py
View file @
28ee3823
...
@@ -444,7 +444,7 @@ class LeaseCreate(LoginRequiredMixin, PolicyMixin,
...
@@ -444,7 +444,7 @@ class LeaseCreate(LoginRequiredMixin, PolicyMixin,
def
get_form_kwargs
(
self
):
def
get_form_kwargs
(
self
):
from
openstack_api
import
keystone
from
openstack_api
import
keystone
kwargs
=
super
(
LeaseCreate
,
self
)
.
get_form_kwargs
()
kwargs
=
super
(
LeaseCreate
,
self
)
.
get_form_kwargs
()
kwargs
[
'roles'
]
=
keystone
.
role_list
(
self
.
request
)
kwargs
[
'roles'
]
=
settings
.
ROLES_SHOWN
return
kwargs
return
kwargs
...
@@ -462,7 +462,7 @@ class LeaseDetail(LoginRequiredMixin, PolicyMixin,
...
@@ -462,7 +462,7 @@ class LeaseDetail(LoginRequiredMixin, PolicyMixin,
def
get_form_kwargs
(
self
):
def
get_form_kwargs
(
self
):
from
openstack_api
import
keystone
from
openstack_api
import
keystone
kwargs
=
super
(
LeaseDetail
,
self
)
.
get_form_kwargs
()
kwargs
=
super
(
LeaseDetail
,
self
)
.
get_form_kwargs
()
kwargs
[
'roles'
]
=
keystone
.
role_list
(
self
.
request
)
kwargs
[
'roles'
]
=
settings
.
ROLES_SHOWN
return
kwargs
return
kwargs
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
...
...
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