From 75ab2947982f6abdb489f3ea68aa478ece4bedc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 6 Nov 2024 17:18:42 +0100 Subject: [PATCH] Fix JSON comparison --- github_app_geo_project/views/webhook.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/github_app_geo_project/views/webhook.py b/github_app_geo_project/views/webhook.py index 427905a7e4..30f2001ff2 100644 --- a/github_app_geo_project/views/webhook.py +++ b/github_app_geo_project/views/webhook.py @@ -253,9 +253,15 @@ def process_event(context: ProcessContext) -> None: elif key == "event_name": update = update.where(models.Queue.event_name == event_name) elif key == "event_data": - update = update.where(models.Queue.event_data == context.event_data) + update = update.where( + sqlalchemy.cast(models.Queue.event_data, sqlalchemy.TEXT) + == sqlalchemy.cast(context.event_data, sqlalchemy.TEXT) + ) elif key == "module_data": - update = update.where(models.Queue.module_data == module_data) + update = update.where( + sqlalchemy.cast(models.Queue.module_data, sqlalchemy.TEXT) + == sqlalchemy.cast(module_data, sqlalchemy.TEXT) + ) else: _LOGGER.error("Unknown jobs_unique_on key: %s", key)