refactor(comment): use new comment type

This commit is contained in:
YuehuCao 2025-09-23 13:18:35 +08:00
parent 794536c372
commit 769e32a6e3

View File

@ -1,5 +1,6 @@
from webapi.config.site_settings import site_settings
from beanie import init_beanie
from fastapi import HTTPException
from motor.motor_asyncio import AsyncIOMotorClient, AsyncIOMotorDatabase
from backend.models.models import MessageTemplateDoc, EmailSenderDoc, EmailSendStatusDoc, EmailTrackingDoc, EmailBounceDoc, UsageLogDoc
from common.config.app_settings import app_settings
@ -86,11 +87,15 @@ class TenantDBCache:
return db
# Create new tenant connection - use raw MongoDB query since we don't have TenantDoc model
# tenant_doc content:
# "tenant_name": "magicleaps",
# "product_id": "68a3f19119cfaf36316f6d14",
# "mongodb_uri": "mongodb://localhost:27017/interview",
# "status": "active"
"""
tenant_doc content:
{
"tenant_name": "magicleaps",
"product_id": "68a3f19119cfaf36316f6d14",
"mongodb_uri": "mongodb://localhost:27017/interview",
"status": "active"
}
"""
tenant = await self.main_db["tenant_doc"].find_one({"product_id": product_id})
if not tenant:
await self.module_logger.log_error(f"Tenant {product_id} does not exist in main database")