Skip to content

Commit

Permalink
[PR #8693/7ca244ef backport][3.10] Fix missing logic in quickstart ex…
Browse files Browse the repository at this point in the history
…ample (#8705)

**This is a backport of PR #8693 as merged into master
(7ca244e).**

Co-authored-by: NewUserHa <32261870+NewUserHa@users.noreply.github.com>
  • Loading branch information
patchback[bot] and NewUserHa authored Aug 15, 2024
1 parent 6a09242 commit 58e8597
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/web_quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,11 @@ third-party library, :mod:`aiohttp_session`, that adds *session* support::

async def handler(request):
session = await get_session(request)
last_visit = session['last_visit'] if 'last_visit' in session else None
text = 'Last visited: {}'.format(last_visit)

last_visit = session.get("last_visit")
session["last_visit"] = time.time()
text = "Last visited: {}".format(last_visit)

return web.Response(text=text)

async def make_app():
Expand Down

0 comments on commit 58e8597

Please sign in to comment.