Skip to content

Commit

Permalink
Fix guest customer handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kichanyurd committed Dec 9, 2024
1 parent 2a02269 commit 0630520
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/parlant/core/customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,16 @@ async def list_customers(
) -> Sequence[Customer]:
return [
await self._deserialize_customer(e) for e in await self._customers_collection.find({})
]
] + [await self.read_customer(CustomerStore.GUEST_ID)]

@override
async def delete_customer(
self,
customer_id: CustomerId,
) -> None:
if customer_id == CustomerStore.GUEST_ID:
raise ValueError("Removing the guest customer is not allowed")

result = await self._customers_collection.delete_one({"id": {"$eq": customer_id}})

if result.deleted_count == 0:
Expand Down

0 comments on commit 0630520

Please sign in to comment.