Set observer/disabled=1 to run an observerless PlanetStack
diff --git a/planetstack/observer/__init__.py b/planetstack/observer/__init__.py
index e69de29..b23caf2 100644
--- a/planetstack/observer/__init__.py
+++ b/planetstack/observer/__init__.py
@@ -0,0 +1,27 @@
+from planetstack.config import Config
+
+try:
+ observer_disabled = Config().observer_disabled
+except:
+ observer_disabled = False
+
+print_once = True
+
+if (not observer_disabled):
+ from .event_manager import EventSender
+
+ def notify_observer(model=None, delete=False):
+ try:
+ if (model and delete):
+ EventSender().fire({'delete_flag':delete,'model':model.__name__})
+ else:
+ EventSender().fire()
+ except Exception,e:
+ print "Exception in Observer. This should not disrupt the front end. %s"%str(e)
+
+else:
+ def notify_observer(model=None, delete=False):
+ if (print_once):
+ print "The observer is disabled"
+ print_once = False
+ return