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
9fd1d4fe
authored
Feb 26, 2015
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: remove exclamation marks
parent
5456e8b3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
30 deletions
+30
-30
circle/network/views.py
+30
-30
No files found.
circle/network/views.py
View file @
9fd1d4fe
...
@@ -137,8 +137,8 @@ class BlacklistDetail(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -137,8 +137,8 @@ class BlacklistDetail(LoginRequiredMixin, SuperuserRequiredMixin,
model
=
BlacklistItem
model
=
BlacklistItem
template_name
=
"network/blacklist-edit.html"
template_name
=
"network/blacklist-edit.html"
form_class
=
BlacklistItemForm
form_class
=
BlacklistItemForm
success_message
=
_
(
u'Successfully modified blacklist item'
success_message
=
_
(
u'Successfully modified blacklist item
'
'
%(ipv4)
s -
%(type)
s
!
'
)
'
%(ipv4)
s -
%(type)
s
.
'
)
def
get_success_url
(
self
):
def
get_success_url
(
self
):
if
'pk'
in
self
.
kwargs
:
if
'pk'
in
self
.
kwargs
:
...
@@ -156,7 +156,7 @@ class BlacklistCreate(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -156,7 +156,7 @@ class BlacklistCreate(LoginRequiredMixin, SuperuserRequiredMixin,
template_name
=
"network/blacklist-create.html"
template_name
=
"network/blacklist-create.html"
form_class
=
BlacklistItemForm
form_class
=
BlacklistItemForm
success_message
=
_
(
u'Successfully created blacklist item '
success_message
=
_
(
u'Successfully created blacklist item '
'
%(ipv4)
s -
%(type)
s
!
'
)
'
%(ipv4)
s -
%(type)
s
.
'
)
class
BlacklistDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
class
BlacklistDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
...
@@ -193,7 +193,7 @@ class DomainDetail(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -193,7 +193,7 @@ class DomainDetail(LoginRequiredMixin, SuperuserRequiredMixin,
model
=
Domain
model
=
Domain
template_name
=
"network/domain-edit.html"
template_name
=
"network/domain-edit.html"
form_class
=
DomainForm
form_class
=
DomainForm
success_message
=
_
(
u'Successfully modified domain
%(name)
s
!
'
)
success_message
=
_
(
u'Successfully modified domain
%(name)
s
.
'
)
def
get_success_url
(
self
):
def
get_success_url
(
self
):
if
'pk'
in
self
.
kwargs
:
if
'pk'
in
self
.
kwargs
:
...
@@ -220,7 +220,7 @@ class DomainCreate(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -220,7 +220,7 @@ class DomainCreate(LoginRequiredMixin, SuperuserRequiredMixin,
model
=
Domain
model
=
Domain
template_name
=
"network/domain-create.html"
template_name
=
"network/domain-create.html"
form_class
=
DomainForm
form_class
=
DomainForm
success_message
=
_
(
u'Successfully created domain
%(name)
s
!
'
)
success_message
=
_
(
u'Successfully created domain
%(name)
s
.
'
)
class
DomainDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
class
DomainDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
...
@@ -237,11 +237,11 @@ class DomainDelete(LoginRequiredMixin, SuperuserRequiredMixin, DeleteView):
...
@@ -237,11 +237,11 @@ class DomainDelete(LoginRequiredMixin, SuperuserRequiredMixin, DeleteView):
def
delete
(
self
,
request
,
*
args
,
**
kwargs
):
def
delete
(
self
,
request
,
*
args
,
**
kwargs
):
self
.
object
=
self
.
get_object
()
self
.
object
=
self
.
get_object
()
if
unicode
(
self
.
object
)
!=
request
.
POST
.
get
(
'confirm'
):
if
unicode
(
self
.
object
)
!=
request
.
POST
.
get
(
'confirm'
):
messages
.
error
(
request
,
_
(
u"Object name does not match
!
"
))
messages
.
error
(
request
,
_
(
u"Object name does not match
.
"
))
return
self
.
get
(
request
,
*
args
,
**
kwargs
)
return
self
.
get
(
request
,
*
args
,
**
kwargs
)
response
=
super
(
DomainDelete
,
self
)
.
delete
(
request
,
*
args
,
**
kwargs
)
response
=
super
(
DomainDelete
,
self
)
.
delete
(
request
,
*
args
,
**
kwargs
)
messages
.
success
(
request
,
_
(
u"Domain successfully deleted
!
"
))
messages
.
success
(
request
,
_
(
u"Domain successfully deleted
.
"
))
return
response
return
response
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
...
@@ -351,7 +351,7 @@ class GroupCreate(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -351,7 +351,7 @@ class GroupCreate(LoginRequiredMixin, SuperuserRequiredMixin,
model
=
Group
model
=
Group
template_name
=
"network/group-create.html"
template_name
=
"network/group-create.html"
form_class
=
GroupForm
form_class
=
GroupForm
success_message
=
_
(
u'Successfully created host group
%(name)
s
!
'
)
success_message
=
_
(
u'Successfully created host group
%(name)
s
.
'
)
class
GroupDetail
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
class
GroupDetail
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
...
@@ -359,7 +359,7 @@ class GroupDetail(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -359,7 +359,7 @@ class GroupDetail(LoginRequiredMixin, SuperuserRequiredMixin,
model
=
Group
model
=
Group
template_name
=
"network/group-edit.html"
template_name
=
"network/group-edit.html"
form_class
=
GroupForm
form_class
=
GroupForm
success_message
=
_
(
u'Successfully modified host group
%(name)
s
!
'
)
success_message
=
_
(
u'Successfully modified host group
%(name)
s
.
'
)
def
get_success_url
(
self
):
def
get_success_url
(
self
):
if
'pk'
in
self
.
kwargs
:
if
'pk'
in
self
.
kwargs
:
...
@@ -443,7 +443,7 @@ class HostDetail(HostMagicMixin, LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -443,7 +443,7 @@ class HostDetail(HostMagicMixin, LoginRequiredMixin, SuperuserRequiredMixin,
model
=
Host
model
=
Host
template_name
=
"network/host-edit.html"
template_name
=
"network/host-edit.html"
form_class
=
HostForm
form_class
=
HostForm
success_message
=
_
(
u'Successfully modified host
%(hostname)
s
!
'
)
success_message
=
_
(
u'Successfully modified host
%(hostname)
s
.
'
)
def
_get_ajax
(
self
,
*
args
,
**
kwargs
):
def
_get_ajax
(
self
,
*
args
,
**
kwargs
):
if
"vlan"
not
in
self
.
request
.
GET
:
if
"vlan"
not
in
self
.
request
.
GET
:
...
@@ -516,7 +516,7 @@ class HostCreate(HostMagicMixin, LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -516,7 +516,7 @@ class HostCreate(HostMagicMixin, LoginRequiredMixin, SuperuserRequiredMixin,
model
=
Host
model
=
Host
template_name
=
"network/host-create.html"
template_name
=
"network/host-create.html"
form_class
=
HostForm
form_class
=
HostForm
success_message
=
_
(
u'Successfully created host
%(hostname)
s
!
'
)
success_message
=
_
(
u'Successfully created host
%(hostname)
s
.
'
)
def
get_initial
(
self
):
def
get_initial
(
self
):
initial
=
super
(
HostCreate
,
self
)
.
get_initial
()
initial
=
super
(
HostCreate
,
self
)
.
get_initial
()
...
@@ -564,11 +564,11 @@ class HostDelete(LoginRequiredMixin, SuperuserRequiredMixin, DeleteView):
...
@@ -564,11 +564,11 @@ class HostDelete(LoginRequiredMixin, SuperuserRequiredMixin, DeleteView):
def
delete
(
self
,
request
,
*
args
,
**
kwargs
):
def
delete
(
self
,
request
,
*
args
,
**
kwargs
):
self
.
object
=
self
.
get_object
()
self
.
object
=
self
.
get_object
()
if
unicode
(
self
.
object
)
!=
request
.
POST
.
get
(
'confirm'
):
if
unicode
(
self
.
object
)
!=
request
.
POST
.
get
(
'confirm'
):
messages
.
error
(
request
,
_
(
u"Object name does not match
!
"
))
messages
.
error
(
request
,
_
(
u"Object name does not match
.
"
))
return
self
.
get
(
request
,
*
args
,
**
kwargs
)
return
self
.
get
(
request
,
*
args
,
**
kwargs
)
response
=
super
(
HostDelete
,
self
)
.
delete
(
request
,
*
args
,
**
kwargs
)
response
=
super
(
HostDelete
,
self
)
.
delete
(
request
,
*
args
,
**
kwargs
)
messages
.
success
(
request
,
_
(
u"Host successfully deleted
!
"
))
messages
.
success
(
request
,
_
(
u"Host successfully deleted
.
"
))
return
response
return
response
...
@@ -598,7 +598,7 @@ class RecordDetail(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -598,7 +598,7 @@ class RecordDetail(LoginRequiredMixin, SuperuserRequiredMixin,
template_name
=
"network/record-edit.html"
template_name
=
"network/record-edit.html"
form_class
=
RecordForm
form_class
=
RecordForm
# TODO fqdn
# TODO fqdn
success_message
=
_
(
u'Successfully modified record
!
'
)
success_message
=
_
(
u'Successfully modified record
.
'
)
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
RecordDetail
,
self
)
.
get_context_data
(
**
kwargs
)
context
=
super
(
RecordDetail
,
self
)
.
get_context_data
(
**
kwargs
)
...
@@ -617,7 +617,7 @@ class RecordCreate(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -617,7 +617,7 @@ class RecordCreate(LoginRequiredMixin, SuperuserRequiredMixin,
template_name
=
"network/record-create.html"
template_name
=
"network/record-create.html"
form_class
=
RecordForm
form_class
=
RecordForm
# TODO fqdn
# TODO fqdn
success_message
=
_
(
u'Successfully created record
!
'
)
success_message
=
_
(
u'Successfully created record
.
'
)
def
get_initial
(
self
):
def
get_initial
(
self
):
initial
=
super
(
RecordCreate
,
self
)
.
get_initial
()
initial
=
super
(
RecordCreate
,
self
)
.
get_initial
()
...
@@ -683,7 +683,7 @@ class RuleDetail(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -683,7 +683,7 @@ class RuleDetail(LoginRequiredMixin, SuperuserRequiredMixin,
model
=
Rule
model
=
Rule
template_name
=
"network/rule-edit.html"
template_name
=
"network/rule-edit.html"
form_class
=
RuleForm
form_class
=
RuleForm
success_message
=
_
(
u'Successfully modified rule
!
'
)
success_message
=
_
(
u'Successfully modified rule
.
'
)
def
get_success_url
(
self
):
def
get_success_url
(
self
):
if
'pk'
in
self
.
kwargs
:
if
'pk'
in
self
.
kwargs
:
...
@@ -703,7 +703,7 @@ class RuleCreate(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -703,7 +703,7 @@ class RuleCreate(LoginRequiredMixin, SuperuserRequiredMixin,
model
=
Rule
model
=
Rule
template_name
=
"network/rule-create.html"
template_name
=
"network/rule-create.html"
form_class
=
RuleForm
form_class
=
RuleForm
success_message
=
_
(
u'Successfully created rule
!
'
)
success_message
=
_
(
u'Successfully created rule
.
'
)
def
get_initial
(
self
):
def
get_initial
(
self
):
initial
=
super
(
RuleCreate
,
self
)
.
get_initial
()
initial
=
super
(
RuleCreate
,
self
)
.
get_initial
()
...
@@ -739,7 +739,7 @@ class SwitchPortDetail(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -739,7 +739,7 @@ class SwitchPortDetail(LoginRequiredMixin, SuperuserRequiredMixin,
model
=
SwitchPort
model
=
SwitchPort
template_name
=
"network/switch-port-edit.html"
template_name
=
"network/switch-port-edit.html"
form_class
=
SwitchPortForm
form_class
=
SwitchPortForm
success_message
=
_
(
u'Succesfully modified switch port
!
'
)
success_message
=
_
(
u'Succesfully modified switch port
.
'
)
def
get_success_url
(
self
):
def
get_success_url
(
self
):
if
'pk'
in
self
.
kwargs
:
if
'pk'
in
self
.
kwargs
:
...
@@ -758,7 +758,7 @@ class SwitchPortCreate(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -758,7 +758,7 @@ class SwitchPortCreate(LoginRequiredMixin, SuperuserRequiredMixin,
model
=
SwitchPort
model
=
SwitchPort
template_name
=
"network/switch-port-create.html"
template_name
=
"network/switch-port-create.html"
form_class
=
SwitchPortForm
form_class
=
SwitchPortForm
success_message
=
_
(
u'Successfully created switch port
!
'
)
success_message
=
_
(
u'Successfully created switch port
.
'
)
class
SwitchPortDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
class
SwitchPortDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
...
@@ -805,7 +805,7 @@ class VlanDetail(VlanMagicMixin, LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -805,7 +805,7 @@ class VlanDetail(VlanMagicMixin, LoginRequiredMixin, SuperuserRequiredMixin,
form_class
=
VlanForm
form_class
=
VlanForm
slug_field
=
'vid'
slug_field
=
'vid'
slug_url_kwarg
=
'vid'
slug_url_kwarg
=
'vid'
success_message
=
_
(
u'Succesfully modified vlan
%(name)
s
!
'
)
success_message
=
_
(
u'Succesfully modified vlan
%(name)
s
.
'
)
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
VlanDetail
,
self
)
.
get_context_data
(
**
kwargs
)
context
=
super
(
VlanDetail
,
self
)
.
get_context_data
(
**
kwargs
)
...
@@ -825,7 +825,7 @@ class VlanCreate(VlanMagicMixin, LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -825,7 +825,7 @@ class VlanCreate(VlanMagicMixin, LoginRequiredMixin, SuperuserRequiredMixin,
model
=
Vlan
model
=
Vlan
template_name
=
"network/vlan-create.html"
template_name
=
"network/vlan-create.html"
form_class
=
VlanForm
form_class
=
VlanForm
success_message
=
_
(
u'Successfully created vlan
%(name)
s
!
'
)
success_message
=
_
(
u'Successfully created vlan
%(name)
s
.
'
)
class
VlanDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
class
VlanDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
...
@@ -846,11 +846,11 @@ class VlanDelete(LoginRequiredMixin, SuperuserRequiredMixin, DeleteView):
...
@@ -846,11 +846,11 @@ class VlanDelete(LoginRequiredMixin, SuperuserRequiredMixin, DeleteView):
def
delete
(
self
,
request
,
*
args
,
**
kwargs
):
def
delete
(
self
,
request
,
*
args
,
**
kwargs
):
self
.
object
=
self
.
get_object
()
self
.
object
=
self
.
get_object
()
if
unicode
(
self
.
object
)
!=
request
.
POST
.
get
(
'confirm'
):
if
unicode
(
self
.
object
)
!=
request
.
POST
.
get
(
'confirm'
):
messages
.
error
(
request
,
_
(
u"Object name does not match
!
"
))
messages
.
error
(
request
,
_
(
u"Object name does not match
.
"
))
return
self
.
get
(
request
,
*
args
,
**
kwargs
)
return
self
.
get
(
request
,
*
args
,
**
kwargs
)
response
=
super
(
VlanDelete
,
self
)
.
delete
(
request
,
*
args
,
**
kwargs
)
response
=
super
(
VlanDelete
,
self
)
.
delete
(
request
,
*
args
,
**
kwargs
)
messages
.
success
(
request
,
_
(
u"Vlan successfully deleted
!
"
))
messages
.
success
(
request
,
_
(
u"Vlan successfully deleted
.
"
))
return
response
return
response
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
...
@@ -892,7 +892,7 @@ class VlanGroupDetail(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -892,7 +892,7 @@ class VlanGroupDetail(LoginRequiredMixin, SuperuserRequiredMixin,
template_name
=
"network/vlan-group-edit.html"
template_name
=
"network/vlan-group-edit.html"
form_class
=
VlanGroupForm
form_class
=
VlanGroupForm
success_url
=
reverse_lazy
(
'network.vlan_group_list'
)
success_url
=
reverse_lazy
(
'network.vlan_group_list'
)
success_message
=
_
(
u'Successfully modified vlan group
%(name)
s
!
'
)
success_message
=
_
(
u'Successfully modified vlan group
%(name)
s
.
'
)
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
context
=
super
(
VlanGroupDetail
,
self
)
.
get_context_data
(
**
kwargs
)
context
=
super
(
VlanGroupDetail
,
self
)
.
get_context_data
(
**
kwargs
)
...
@@ -905,7 +905,7 @@ class VlanGroupCreate(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -905,7 +905,7 @@ class VlanGroupCreate(LoginRequiredMixin, SuperuserRequiredMixin,
model
=
VlanGroup
model
=
VlanGroup
template_name
=
"network/vlan-group-create.html"
template_name
=
"network/vlan-group-create.html"
form_class
=
VlanGroupForm
form_class
=
VlanGroupForm
success_message
=
_
(
u'Successfully created vlan group
%(name)
s
!
'
)
success_message
=
_
(
u'Successfully created vlan group
%(name)
s
.
'
)
class
VlanGroupDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
class
VlanGroupDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
...
@@ -938,7 +938,7 @@ def remove_host_group(request, **kwargs):
...
@@ -938,7 +938,7 @@ def remove_host_group(request, **kwargs):
host
.
groups
.
remove
(
group
)
host
.
groups
.
remove
(
group
)
if
not
request
.
is_ajax
():
if
not
request
.
is_ajax
():
messages
.
success
(
request
,
_
(
u"Successfully removed
%(host)
s from "
messages
.
success
(
request
,
_
(
u"Successfully removed
%(host)
s from "
"
%(group)
s group
!
"
%
{
"
%(group)
s group
.
"
%
{
'host'
:
host
,
'host'
:
host
,
'group'
:
group
'group'
:
group
}))
}))
...
@@ -954,7 +954,7 @@ def add_host_group(request, **kwargs):
...
@@ -954,7 +954,7 @@ def add_host_group(request, **kwargs):
host
.
groups
.
add
(
group
)
host
.
groups
.
add
(
group
)
if
not
request
.
is_ajax
():
if
not
request
.
is_ajax
():
messages
.
success
(
request
,
_
(
u"Successfully added
%(host)
s to group"
messages
.
success
(
request
,
_
(
u"Successfully added
%(host)
s to group"
"
%(group)
s
!
"
%
{
"
%(group)
s
.
"
%
{
'host'
:
host
,
'host'
:
host
,
'group'
:
group
'group'
:
group
}))
}))
...
@@ -973,7 +973,7 @@ def remove_switch_port_device(request, **kwargs):
...
@@ -973,7 +973,7 @@ def remove_switch_port_device(request, **kwargs):
device
.
delete
()
device
.
delete
()
if
not
request
.
is_ajax
():
if
not
request
.
is_ajax
():
messages
.
success
(
request
,
_
(
u"Successfully deleted ethernet device"
messages
.
success
(
request
,
_
(
u"Successfully deleted ethernet device"
"
%(name)
s
!
"
%
{
"
%(name)
s
.
"
%
{
'name'
:
device
.
name
,
'name'
:
device
.
name
,
}))
}))
return
redirect
(
reverse_lazy
(
'network.switch_port'
,
return
redirect
(
reverse_lazy
(
'network.switch_port'
,
...
@@ -997,9 +997,9 @@ def add_switch_port_device(request, **kwargs):
...
@@ -997,9 +997,9 @@ def add_switch_port_device(request, **kwargs):
return
redirect
(
reverse_lazy
(
'network.switch_port'
,
kwargs
=
kwargs
))
return
redirect
(
reverse_lazy
(
'network.switch_port'
,
kwargs
=
kwargs
))
elif
not
len
(
device_name
)
>
0
:
elif
not
len
(
device_name
)
>
0
:
messages
.
error
(
request
,
_
(
"Ethernet device name cannot be empty
!
"
))
messages
.
error
(
request
,
_
(
"Ethernet device name cannot be empty
.
"
))
return
redirect
(
reverse_lazy
(
'network.switch_port'
,
kwargs
=
kwargs
))
return
redirect
(
reverse_lazy
(
'network.switch_port'
,
kwargs
=
kwargs
))
elif
EthernetDevice
.
objects
.
get
(
name
=
device_name
)
is
not
None
:
elif
EthernetDevice
.
objects
.
get
(
name
=
device_name
)
is
not
None
:
messages
.
error
(
request
,
_
(
"There is already an ethernet device with"
messages
.
error
(
request
,
_
(
"There is already an ethernet device with"
" that name
!
"
))
" that name
.
"
))
return
redirect
(
reverse_lazy
(
'network.switch_port'
,
kwargs
=
kwargs
))
return
redirect
(
reverse_lazy
(
'network.switch_port'
,
kwargs
=
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