fix: get_brain_details API to include user_id parameter (#2242)

This pull request fixes the `get_brain_details` API by adding a
`user_id` parameter. Previously, the API did not include the `user_id`
parameter, which caused issues when retrieving brain details. This fix
ensures that the `user_id` is passed correctly to the API, allowing for
accurate retrieval of brain details.
This commit is contained in:
Stan Girard 2024-02-22 12:48:34 -08:00 committed by GitHub
parent bc52146430
commit 73d5e7b808
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,5 @@
from uuid import UUID
from logger import get_logger
from models import BrainSettings, BrainSubscription
from modules.brain.service.brain_service import BrainService
@ -12,13 +14,16 @@ brain_service = BrainService()
def resend_invitation_email(
brain_subscription: BrainSubscription,
inviter_email: str,
user_id: UUID,
origin: str = "https://www.quivr.app",
):
brains_settings = BrainSettings() # pyright: ignore reportPrivateUsage=none
brain_url = get_brain_url(origin, brain_subscription.brain_id)
invitation_brain = brain_service.get_brain_details(brain_subscription.brain_id)
invitation_brain = brain_service.get_brain_details(
brain_subscription.brain_id, user_id
)
if invitation_brain is None:
raise Exception("Brain not found")
brain_name = invitation_brain.name

View File

@ -82,6 +82,7 @@ def invite_users_to_brain(
resend_invitation_email(
subscription,
inviter_email=current_user.email or "Quivr",
user_id=current_user.id,
origin=origin,
)
except Exception as e: