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