From fc24779b2cb050be08c74e84a409a7abfa429c50 Mon Sep 17 00:00:00 2001 From: Hiroshi Nishio <4620828+hiroshinishio@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:16:34 +0900 Subject: [PATCH] Fix a bug in get_installation_id() --- services/supabase/gitauto_manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/supabase/gitauto_manager.py b/services/supabase/gitauto_manager.py index 88014055..67c40789 100644 --- a/services/supabase/gitauto_manager.py +++ b/services/supabase/gitauto_manager.py @@ -1,6 +1,7 @@ """Class to manage all GitAuto related operations""" from datetime import datetime, timezone +import json from supabase import Client from services.stripe.customer import create_stripe_customer, subscribe_to_free_plan from utils.handle_exceptions import handle_exceptions @@ -156,9 +157,10 @@ def get_installation_id(self, owner_id: int) -> int: self.client.table(table_name="installations") .select("installation_id") .eq(column="owner_id", value=owner_id) - .eq(column="uninstalled_at", value=None) # Not uninstalled + .is_(column="uninstalled_at", value="null") # Not uninstalled .execute() ) + print(f"Data: {json.dumps(obj=data, indent=2)}") # Return the first installation id even if there are multiple installations return data[1][0]["installation_id"]