Update support for unique user IDs (#2921)

This commit is contained in:
Akshat Jain
2025-06-07 21:20:40 +05:30
committed by GitHub
parent e1dc27276b
commit 4dec9ace88
3 changed files with 44 additions and 2 deletions

View File

@@ -212,7 +212,8 @@ async def create_memory(
if not user:
raise HTTPException(status_code=404, detail="User not found")
# Get or create app
app_obj = db.query(App).filter(App.name == request.app).first()
app_obj = db.query(App).filter(App.name == request.app,
App.owner_id == user.id).first()
if not app_obj:
app_obj = App(name=request.app, owner_id=user.id)
db.add(app_obj)