Skip to content

Commit f5b40c7

Browse files
ntaroraseratch
authored andcommitted
Fix #747 by updating async SQLAlchemy OAuth example code (#748)
1 parent d17907f commit f5b40c7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/sqlalchemy/async_oauth_app.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,17 @@ async def async_save(self, installation: Installation):
6363
b["client_id"] = self.client_id
6464
await database.execute(self.bots.insert(), b)
6565

66-
async def async_find_bot(self, *, enterprise_id: Optional[str], team_id: Optional[str]) -> Optional[Bot]:
66+
async def async_find_bot(
67+
self, *, enterprise_id: Optional[str], team_id: Optional[str], is_enterprise_install: Optional[bool]
68+
) -> Optional[Bot]:
6769
c = self.bots.c
6870
query = (
6971
self.bots.select()
70-
.where(and_(c.enterprise_id == enterprise_id, c.team_id == team_id))
72+
.where(
73+
and_(
74+
c.enterprise_id == enterprise_id, c.team_id == team_id, c.is_enterprise_install == is_enterprise_install
75+
)
76+
)
7177
.order_by(desc(c.installed_at))
7278
.limit(1)
7379
)

0 commit comments

Comments
 (0)