def update_after_commit_hook(is_commit_successful, context, service, indicator): if not is_commit_successful: return try: ws_url = get_settings_property('ws_endpoint') ws_key = get_settings_property('ws_key') registry = get_registry(context) reporter = WebServiceReporter(ws_url, ws_key) reporter.report(get_data_to_report(registry, service, indicator)) logger.info("Indicators were successfully reported") except RegistryException as e: logger.warning( "Error while loading indicator registry ({0})".format(e)) except ReporterException as e: logger.warning("Error while reporting indicators ({0})".format(e))
def is_updating_enabled(): return (get_settings_property('service_id') and get_settings_property('ws_endpoint') and get_settings_property('ws_key'))
def update_indicators_on_acord_deletion(obj, event): update_indicators_if_state(obj, ('intranet', 'published'), service=get_settings_property('service_id'), indicator='acord-n')
def update_indicators_on_acord_review_state_change(obj, event): update_indicators(obj, service=get_settings_property('service_id'), indicator='acord-n')
def update_indicators_on_sessio_deletion(obj, event): update_indicators_if_state(obj, ('convocada', ), service=get_settings_property('service_id'), indicator='sessio-n')