From f6bcbe664cf05c0997d1f0a4abcd55c8790ec8ca Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Oct 2025 00:38:12 +0000 Subject: [PATCH] Fix event handler signature to async def handler(event_data, context) --- bitbylaw/steps/advoware_cal_sync/calendar_sync_api_step.py | 3 ++- bitbylaw/steps/advoware_cal_sync/calendar_sync_cron_step.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bitbylaw/steps/advoware_cal_sync/calendar_sync_api_step.py b/bitbylaw/steps/advoware_cal_sync/calendar_sync_api_step.py index 8886625e..c778dfc3 100644 --- a/bitbylaw/steps/advoware_cal_sync/calendar_sync_api_step.py +++ b/bitbylaw/steps/advoware_cal_sync/calendar_sync_api_step.py @@ -12,7 +12,8 @@ config = { 'flows': ['advoware'] } -async def handler(req, context): +async def handler(req): + context = req.context try: # Konfiguration aus Request-Body body = req.get('body', {}) diff --git a/bitbylaw/steps/advoware_cal_sync/calendar_sync_cron_step.py b/bitbylaw/steps/advoware_cal_sync/calendar_sync_cron_step.py index 03ca6719..0cfeb75d 100644 --- a/bitbylaw/steps/advoware_cal_sync/calendar_sync_cron_step.py +++ b/bitbylaw/steps/advoware_cal_sync/calendar_sync_cron_step.py @@ -14,7 +14,7 @@ config = { 'flows': ['advoware'] } -async def get_advoware_employees(advoware): +async def get_advoware_employees(context, advoware): """Fetch list of employees from Advoware.""" try: result = await advoware.api_call('api/v1/advonet/Mitarbeiter', method='GET', params={'aktiv': 'true'}) @@ -33,7 +33,7 @@ async def handler(context): advoware = AdvowareAPI(context) # Fetch employees - employees = await get_advoware_employees(advoware) + employees = await get_advoware_employees(context, advoware) if not employees: context.logger.error("Keine Mitarbeiter gefunden. Cron abgebrochen.") return {'status': 500, 'body': {'error': 'Keine Mitarbeiter gefunden'}}