git://git.onelab.eu
/
plstackapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
51d4039
)
fix model_policies being called with class instead of instance
author
Scott Baker
<smbaker@gmail.com>
Tue, 30 Sep 2014 21:53:45 +0000
(14:53 -0700)
committer
Scott Baker
<smbaker@gmail.com>
Tue, 30 Sep 2014 21:53:45 +0000
(14:53 -0700)
planetstack/model_policy.py
patch
|
blob
|
history
diff --git
a/planetstack/model_policy.py
b/planetstack/model_policy.py
index
dbe8453
..
32d8f8e
100644
(file)
--- a/
planetstack/model_policy.py
+++ b/
planetstack/model_policy.py
@@
-5,13
+5,13
@@
from core.models import *
import model_policies
@receiver(post_save)
-def post_save_handler(sender, **kwargs):
+def post_save_handler(sender,
instance,
**kwargs):
sender_name = sender.__name__
policy_name = 'model_policy_%s'%sender_name
if (not kwargs['update_fields']):
try:
policy_handler = getattr(model_policies, policy_name)
- policy_handler.handle(
sender
)
+ policy_handler.handle(
instance
)
except:
pass