| from planetstack.config import Config |
| observer_disabled = Config().observer_disabled |
| observer_disabled = False |
| """ used for manage.py --noobserver """ |
| observer_disabled = not x |
| def notify_observer(model=None, delete=False, pk=None, model_dict={}): |
| print "The observer is disabled" |
| from .event_manager import EventSender |
| if hasattr(model,"__name__"): |
| modelName = model.__name__ |
| modelName = model.__class__.__name__ |
| EventSender().fire(delete_flag = delete, model = modelName, pk = pk, model_dict=model_dict) |
| print "Exception in Observer. This should not disrupt the front end. %s"%str(e) |