fixed storage error

This commit is contained in:
belviskhoremk
2026-05-27 23:17:34 +00:00
parent a10c95d8dd
commit fad2b3a9f3
9 changed files with 141 additions and 102 deletions

View File

@@ -103,8 +103,9 @@ async def stripe_webhook(
if event_type == "checkout.session.completed":
session = event.data.object
user_id = (session.metadata or {}).get("user_id")
plan = (session.metadata or {}).get("plan", "starter")
metadata = session.metadata
user_id = getattr(metadata, "user_id", None) if metadata else None
plan = getattr(metadata, "plan", "starter") if metadata else "starter"
customer_id = session.customer
subscription_id = session.subscription
@@ -166,7 +167,7 @@ async def stripe_webhook(
except HTTPException:
raise
except Exception as e:
logger.error(f"Webhook error: {e}")
logger.exception(f"Webhook error: {e}")
raise HTTPException(status_code=500, detail=str(e))

View File

@@ -404,7 +404,7 @@ async def refresh_url_source(
"status": "pending",
"error_message": None,
"chunk_count": 0,
}).eq("id", source_id).returning("representation").execute()
}).eq("id", source_id).execute()
background_tasks.add_task(_process_url_source, source_id, src["url"], chatbot_id, supabase)