avoid throwing exception for model_policies that don't exist
diff --git a/planetstack/model_policy.py b/planetstack/model_policy.py
index 32d8f8e..ba0cb99 100644
--- a/planetstack/model_policy.py
+++ b/planetstack/model_policy.py
@@ -11,7 +11,8 @@
if (not kwargs['update_fields']):
try:
- policy_handler = getattr(model_policies, policy_name)
- policy_handler.handle(instance)
+ policy_handler = getattr(model_policies, policy_name, None)
+ if policy_handler is not None:
+ policy_handler.handle(instance)
except:
pass