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
e23b3021
authored
Oct 08, 2013
by
Bach Dániel
Committed by
Bach Dániel
Oct 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: add post_delete signals for models
parent
f2fc6c3e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
circle/firewall/models.py
+6
-11
No files found.
circle/firewall/models.py
View file @
e23b3021
...
@@ -9,7 +9,7 @@ from firewall.fields import (MACAddressField, val_alfanum, val_reverse_domain,
...
@@ -9,7 +9,7 @@ from firewall.fields import (MACAddressField, val_alfanum, val_reverse_domain,
ipv4_2_ipv6
,
IPNetworkField
)
ipv4_2_ipv6
,
IPNetworkField
)
from
django.core.validators
import
MinValueValidator
,
MaxValueValidator
from
django.core.validators
import
MinValueValidator
,
MaxValueValidator
import
django.conf
import
django.conf
from
django.db.models.signals
import
post_save
from
django.db.models.signals
import
post_save
,
post_delete
import
random
import
random
from
firewall.tasks.local_tasks
import
reloadtask
from
firewall.tasks.local_tasks
import
reloadtask
...
@@ -800,16 +800,11 @@ class Blacklist(models.Model):
...
@@ -800,16 +800,11 @@ class Blacklist(models.Model):
return
(
'network.blacklist'
,
None
,
{
'pk'
:
self
.
pk
})
return
(
'network.blacklist'
,
None
,
{
'pk'
:
self
.
pk
})
def
send_task
(
sender
,
instance
,
created
,
**
kwargs
):
def
send_task
(
sender
,
instance
,
created
=
False
,
**
kwargs
):
reloadtask
.
apply_async
(
args
=
[
sender
.
__name__
])
reloadtask
.
apply_async
(
args
=
[
sender
.
__name__
])
post_save
.
connect
(
send_task
,
sender
=
Host
)
for
sender
in
[
Host
,
Rule
,
Domain
,
Record
,
Vlan
,
Firewall
,
Group
,
Blacklist
,
post_save
.
connect
(
send_task
,
sender
=
Rule
)
SwitchPort
,
EthernetDevice
]:
post_save
.
connect
(
send_task
,
sender
=
Domain
)
post_save
.
connect
(
send_task
,
sender
=
sender
)
post_save
.
connect
(
send_task
,
sender
=
Record
)
post_delete
.
connect
(
send_task
,
sender
=
sender
)
post_save
.
connect
(
send_task
,
sender
=
Vlan
)
post_save
.
connect
(
send_task
,
sender
=
Firewall
)
post_save
.
connect
(
send_task
,
sender
=
Group
)
post_save
.
connect
(
send_task
,
sender
=
Host
)
post_save
.
connect
(
send_task
,
sender
=
Blacklist
)
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