blob: b23caf25b23fdb4c7f89f419f3ee0fa40495bce6 [file] [log] [blame]
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