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
dd20a906
authored
May 16, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: save vlans of vlangroups
parent
4d5d449d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
firewall_gui/views.py
+13
-3
No files found.
firewall_gui/views.py
View file @
dd20a906
...
@@ -489,9 +489,8 @@ def save_vlan(request):
...
@@ -489,9 +489,8 @@ def save_vlan(request):
nat_to
=
Vlan
.
objects
.
get
(
name
=
group
[
'name'
])
nat_to
=
Vlan
.
objects
.
get
(
name
=
group
[
'name'
])
vlan
.
snat_to
.
add
(
nat_to
)
vlan
.
snat_to
.
add
(
nat_to
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
e
,
group
)
errors
[
'vlans'
]
=
(
'Vlan with the name "
%(name)
s" does not exists!'
)
%
{
errors
[
'vlans'
]
=
(
'Vlan with the name "
%(name)
s" does not exists!'
)
%
{
'name'
:
e
.
message
#
group['name']
'name'
:
group
[
'name'
]
}
}
try
:
try
:
vlan
.
full_clean
()
vlan
.
full_clean
()
...
@@ -512,7 +511,18 @@ def save_vlangroup(request):
...
@@ -512,7 +511,18 @@ def save_vlangroup(request):
errors
=
{}
errors
=
{}
vlangroup
.
name
=
data
[
'name'
]
vlangroup
.
name
=
data
[
'name'
]
vlangroup
.
description
=
data
[
'description'
]
vlangroup
.
description
=
data
[
'description'
]
# TODO: save vlans
for
vlan
in
data
[
'vlans'
]:
try
:
if
'__destroyed'
in
vlan
and
vlan
[
'__destroyed'
]:
vlan_obj
=
Vlan
.
objects
.
get
(
name
=
vlan
[
'name'
])
vlangroup
.
vlans
.
remove
(
vlan_obj
)
elif
'__created'
in
vlan
and
vlan
[
'__created'
]:
vlan_obj
=
Vlan
.
objects
.
get
(
name
=
vlan
[
'name'
])
vlangroup
.
vlans
.
add
(
vlan_obj
)
except
Exception
as
e
:
errors
[
'vlans'
]
=
(
'Vlan with the name "
%(name)
s" does not exists!'
)
%
{
'name'
:
vlan
[
'name'
]
}
set_field
(
vlangroup
,
'owner'
,
errors
,
username
=
data
[
'owner'
][
'name'
])
set_field
(
vlangroup
,
'owner'
,
errors
,
username
=
data
[
'owner'
][
'name'
])
try
:
try
:
vlangroup
.
full_clean
()
vlangroup
.
full_clean
()
...
...
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