Exemple #1
0
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))
Exemple #2
0
def is_updating_enabled():
    return (get_settings_property('service_id')
            and get_settings_property('ws_endpoint')
            and get_settings_property('ws_key'))
Exemple #3
0
def update_indicators_on_acord_deletion(obj, event):
    update_indicators_if_state(obj, ('intranet', 'published'),
                               service=get_settings_property('service_id'),
                               indicator='acord-n')
Exemple #4
0
def update_indicators_on_acord_review_state_change(obj, event):
    update_indicators(obj,
                      service=get_settings_property('service_id'),
                      indicator='acord-n')
Exemple #5
0
def update_indicators_on_sessio_deletion(obj, event):
    update_indicators_if_state(obj, ('convocada', ),
                               service=get_settings_property('service_id'),
                               indicator='sessio-n')