Skip to content

Commit

Permalink
fix get_conversation_author
Browse files Browse the repository at this point in the history
  • Loading branch information
willydouhard committed Nov 7, 2023
1 parent 96944e3 commit e37ed25
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions backend/chainlit/client/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ async def get_conversation_author(self, conversation_id: str) -> Optional[str]:
}
res = await self.query(query, variables)
self.check_for_errors(res, raise_error=True)
app_user = res.get("data", {}).get("conversation", {}).get("appUser")
if app_user:
return app_user.get("username")
else:
return None
data = res.get("data")
conversation = data.get("conversation") if data else None
return (
conversation["appUser"].get("username") if conversation["appUser"] else None
)

async def get_conversation(self, conversation_id: str) -> ConversationDict:
query = """
Expand Down

0 comments on commit e37ed25

Please sign in to comment.