Changed interface to policy handlers, slightly
diff --git a/planetstack/model_policy.py b/planetstack/model_policy.py
index 38caf01..fa55817 100644
--- a/planetstack/model_policy.py
+++ b/planetstack/model_policy.py
@@ -1,14 +1,15 @@
from django.db.models.signals import post_save
from django.dispatch import receiver
import pdb
-from model_policies import *
+from core.models import *
+import model_policies
@receiver(post_save)
def post_save_handler(sender, **kwargs):
sender_name = sender.__name__
policy_name = 'model_policy_%s'%sender_name
try:
- policy_handler = globals[policy_name]
- policy_handler(sender)
+ policy_handler = getattr(model_policies, policy_name)
+ policy_handler.handle(sender)
except:
pass