diff options
author | Frederick Muriuki Muriithi | 2024-05-02 04:56:27 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-05-02 05:40:57 +0300 |
commit | abb8ab84cd948edbe9e678aebbaa5a59681c5adc (patch) | |
tree | 1487cb3462b4aa5a0c8d91992c78d5e0ac08b75f | |
parent | 24bc0df2ae77867f80850ea52ff20736271f4b89 (diff) | |
download | gn-auth-abb8ab84cd948edbe9e678aebbaa5a59681c5adc.tar.gz |
use dataclasses' asdict() function.
-rw-r--r-- | gn_auth/auth/authorisation/users/admin/views.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gn_auth/auth/authorisation/users/admin/views.py b/gn_auth/auth/authorisation/users/admin/views.py index f343da1..a4c4033 100644 --- a/gn_auth/auth/authorisation/users/admin/views.py +++ b/gn_auth/auth/authorisation/users/admin/views.py @@ -5,6 +5,7 @@ import random import string from typing import Optional from functools import partial +from dataclasses import asdict from urllib.parse import urlparse from datetime import datetime, timezone, timedelta @@ -80,7 +81,7 @@ def login(): user = user_by_email(conn, email["email"]) if valid_login(conn, user, password): session.update_session_info( - user=user._asdict(), + user=asdict(user), expires=( datetime.now(tz=timezone.utc) + timedelta(minutes=10))) return redirect(url_for(next_uri)) |