Skip to content

Commit

Permalink
Fix a bug in get_installation_id()
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshinishio committed Jul 2, 2024
1 parent 148e305 commit fc24779
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion services/supabase/gitauto_manager.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"]

Expand Down

0 comments on commit fc24779

Please sign in to comment.