From 9051ec38169baf34d512c730b744ed2d246fc067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 21 Feb 2019 10:15:39 +0400 Subject: [PATCH] :memo: Improve naming of middleware in SQLAlchemy tutorial --- docs/release-notes.md | 2 ++ docs/src/sql_databases/tutorial001.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index c4390bdd5..212534b67 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,5 +1,7 @@ ## Next +* Improve middleware naming in tutorial for SQL with SQLAlchemy https://fastapi.tiangolo.com/tutorial/sql-databases/. + ## 0.6.1 * Add docs for GraphQL: https://fastapi.tiangolo.com/tutorial/graphql/. PR #48. diff --git a/docs/src/sql_databases/tutorial001.py b/docs/src/sql_databases/tutorial001.py index 552e0f5da..fe5a01687 100644 --- a/docs/src/sql_databases/tutorial001.py +++ b/docs/src/sql_databases/tutorial001.py @@ -60,7 +60,7 @@ def read_user(request: Request, user_id: int): @app.middleware("http") -async def close_db(request: Request, call_next): +async def db_session_middleware(request: Request, call_next): request.state.db = Session() response = await call_next(request) request.state.db.close()