Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c79a3431
authored
Sep 09, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: rename AclUserAddForm
parent
1ba46618
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
circle/dashboard/forms.py
+5
-2
circle/dashboard/views.py
+4
-4
circle/network/views.py
+2
-2
No files found.
circle/dashboard/forms.py
View file @
c79a3431
...
@@ -1055,9 +1055,12 @@ class UserCreationForm(OrgUserCreationForm):
...
@@ -1055,9 +1055,12 @@ class UserCreationForm(OrgUserCreationForm):
return
user
return
user
class
AclUserAddForm
(
forms
.
Form
):
class
AclUser
OrGroup
AddForm
(
forms
.
Form
):
name
=
forms
.
CharField
(
widget
=
autocomplete_light
.
TextWidget
(
name
=
forms
.
CharField
(
widget
=
autocomplete_light
.
TextWidget
(
'AclUserAutocomplete'
,
attrs
=
{
'class'
:
'form-control'
}))
'AclUserGroupAutocomplete'
,
autocomplete_js_attributes
=
{
'placeholder'
:
_
(
"Name of group or user"
)},
attrs
=
{
'class'
:
'form-control'
}))
class
UserKeyForm
(
forms
.
ModelForm
):
class
UserKeyForm
(
forms
.
ModelForm
):
...
...
circle/dashboard/views.py
View file @
c79a3431
...
@@ -70,7 +70,7 @@ from .forms import (
...
@@ -70,7 +70,7 @@ from .forms import (
UserCreationForm
,
GroupProfileUpdateForm
,
UnsubscribeForm
,
UserCreationForm
,
GroupProfileUpdateForm
,
UnsubscribeForm
,
VmSaveForm
,
UserKeyForm
,
VmRenewForm
,
VmStateChangeForm
,
VmSaveForm
,
UserKeyForm
,
VmRenewForm
,
VmStateChangeForm
,
CirclePasswordChangeForm
,
VmCreateDiskForm
,
VmDownloadDiskForm
,
CirclePasswordChangeForm
,
VmCreateDiskForm
,
VmDownloadDiskForm
,
TraitsForm
,
RawDataForm
,
GroupPermissionForm
,
AclUserAddForm
,
TraitsForm
,
RawDataForm
,
GroupPermissionForm
,
AclUser
OrGroup
AddForm
,
VmResourcesForm
,
VmAddInterfaceForm
,
VmListSearchForm
,
VmResourcesForm
,
VmAddInterfaceForm
,
VmListSearchForm
,
TemplateListSearchForm
,
ConnectCommandForm
TemplateListSearchForm
,
ConnectCommandForm
)
)
...
@@ -390,7 +390,7 @@ class VmDetailView(CheckedDetailView):
...
@@ -390,7 +390,7 @@ class VmDetailView(CheckedDetailView):
)
.
all
()
)
.
all
()
context
[
'acl'
]
=
AclUpdateView
.
get_acl_data
(
context
[
'acl'
]
=
AclUpdateView
.
get_acl_data
(
instance
,
self
.
request
.
user
,
'dashboard.views.vm-acl'
)
instance
,
self
.
request
.
user
,
'dashboard.views.vm-acl'
)
context
[
'aclform'
]
=
AclUserAddForm
()
context
[
'aclform'
]
=
AclUser
OrGroup
AddForm
()
context
[
'os_type_icon'
]
=
instance
.
os_type
.
replace
(
"unknown"
,
context
[
'os_type_icon'
]
=
instance
.
os_type
.
replace
(
"unknown"
,
"question"
)
"question"
)
# ipv6 infos
# ipv6 infos
...
@@ -1282,7 +1282,7 @@ class GroupDetailView(CheckedDetailView):
...
@@ -1282,7 +1282,7 @@ class GroupDetailView(CheckedDetailView):
context
[
'acl'
]
=
AclUpdateView
.
get_acl_data
(
context
[
'acl'
]
=
AclUpdateView
.
get_acl_data
(
self
.
object
.
profile
,
self
.
request
.
user
,
self
.
object
.
profile
,
self
.
request
.
user
,
'dashboard.views.group-acl'
)
'dashboard.views.group-acl'
)
context
[
'aclform'
]
=
AclUserAddForm
()
context
[
'aclform'
]
=
AclUser
OrGroup
AddForm
()
context
[
'group_profile_form'
]
=
GroupProfileUpdate
.
get_form_object
(
context
[
'group_profile_form'
]
=
GroupProfileUpdate
.
get_form_object
(
self
.
request
,
self
.
object
.
profile
)
self
.
request
,
self
.
object
.
profile
)
...
@@ -1717,7 +1717,7 @@ class TemplateDetail(LoginRequiredMixin, SuccessMessageMixin, UpdateView):
...
@@ -1717,7 +1717,7 @@ class TemplateDetail(LoginRequiredMixin, SuccessMessageMixin, UpdateView):
obj
,
self
.
request
.
user
,
'dashboard.views.template-acl'
)
obj
,
self
.
request
.
user
,
'dashboard.views.template-acl'
)
context
[
'disks'
]
=
obj
.
disks
.
all
()
context
[
'disks'
]
=
obj
.
disks
.
all
()
context
[
'is_owner'
]
=
obj
.
has_level
(
self
.
request
.
user
,
'owner'
)
context
[
'is_owner'
]
=
obj
.
has_level
(
self
.
request
.
user
,
'owner'
)
context
[
'aclform'
]
=
AclUserAddForm
()
context
[
'aclform'
]
=
AclUser
OrGroup
AddForm
()
return
context
return
context
def
get_success_url
(
self
):
def
get_success_url
(
self
):
...
...
circle/network/views.py
View file @
c79a3431
...
@@ -42,7 +42,7 @@ from operator import itemgetter
...
@@ -42,7 +42,7 @@ from operator import itemgetter
from
itertools
import
chain
from
itertools
import
chain
import
json
import
json
from
dashboard.views
import
AclUpdateView
from
dashboard.views
import
AclUpdateView
from
dashboard.forms
import
AclUserAddForm
from
dashboard.forms
import
AclUser
OrGroup
AddForm
class
SuccessMessageMixin
(
FormMixin
):
class
SuccessMessageMixin
(
FormMixin
):
...
@@ -654,7 +654,7 @@ class VlanDetail(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -654,7 +654,7 @@ class VlanDetail(LoginRequiredMixin, SuperuserRequiredMixin,
context
[
'vlan_vid'
]
=
self
.
kwargs
.
get
(
'vid'
)
context
[
'vlan_vid'
]
=
self
.
kwargs
.
get
(
'vid'
)
context
[
'acl'
]
=
AclUpdateView
.
get_acl_data
(
context
[
'acl'
]
=
AclUpdateView
.
get_acl_data
(
self
.
object
,
self
.
request
.
user
,
'network.vlan-acl'
)
self
.
object
,
self
.
request
.
user
,
'network.vlan-acl'
)
context
[
'aclform'
]
=
AclUserAddForm
()
context
[
'aclform'
]
=
AclUser
OrGroup
AddForm
()
return
context
return
context
success_url
=
reverse_lazy
(
'network.vlan_list'
)
success_url
=
reverse_lazy
(
'network.vlan_list'
)
...
...
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