"""Method sending successful notification.""" from lib import constants from lib.utils import ows from tasks.accounting_period_mechanicals import helpers def notify_success_task(dag_run, **kwargs): """Mark mechanical deductions state status as 'complete'.""" event = helpers.get_event_from_params(dag_run, **kwargs) mechanical_action = helpers.get_mechanical_deduction_state(event.target_id) ows.update_abacus_state( mechanical_action['abacus_state_id'], body=dict( action_status=constants.ABACUS_STATE_STATUSES.COMPLETE ) )