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
3ed3adb8
authored
May 22, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: fix saving issues
parent
0393bf07
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
firewall_gui/static/partials/rule-list.html
+1
-1
firewall_gui/views.py
+3
-2
No files found.
firewall_gui/static/partials/rule-list.html
View file @
3ed3adb8
...
...
@@ -41,7 +41,7 @@
<td>
{{rule.description}}
</td>
<td>
<a
class=
"btn"
href=
"#/rules/{{rule.id}}/"
>
Szerkesztés
</a>
<
a
class=
"btn btn-danger"
href=
"#/rules/{{rule.id}}/delete/"
>
Törlés
</a
>
<
button
class=
"btn btn-danger"
ng-click=
"deleteEntity(rule.id)"
>
Törlés
</button
>
</td>
</tr>
</table>
firewall_gui/views.py
View file @
3ed3adb8
...
...
@@ -481,7 +481,7 @@ def set_field(object, attr, errors, **kwargs):
@user_passes_test
(
req_staff
)
def
save_rule
(
request
):
data
=
json
.
loads
(
request
.
body
)
if
'id'
in
data
:
if
'id'
in
data
and
data
[
'id'
]
:
rule
=
get_object_or_404
(
Rule
,
id
=
data
[
'id'
])
else
:
rule
=
Rule
()
...
...
@@ -495,6 +495,7 @@ def save_rule(request):
rule
.
accept
=
data
[
'accept'
]
rule
.
nat
=
data
[
'nat'
]
rule
.
nat_dport
=
data
[
'nat_dport'
]
rule
.
r_type
=
data
[
'target'
][
'type'
]
set_field
(
rule
,
'owner'
,
errors
,
username
=
data
[
'owner'
][
'name'
])
for
attr
in
[
'host'
,
'hostgroup'
,
'vlan'
,
'vlangroup'
,
'firewall'
]:
searchBy
=
'name'
if
attr
!=
'host'
else
'hostname'
...
...
@@ -510,7 +511,7 @@ def save_rule(request):
if
len
(
errors
)
>
0
:
return
HttpResponse
(
json
.
dumps
(
errors
),
content_type
=
'application/json'
,
status
=
400
)
rule
.
save
()
return
HttpResponse
(
'KTHXBYE'
)
return
HttpResponse
(
rule
.
id
)
@user_passes_test
(
req_staff
)
def
save_host
(
request
):
...
...
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