aboutsummaryrefslogtreecommitdiff
path: root/gn_auth
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-05-02 04:56:27 +0300
committerFrederick Muriuki Muriithi2024-05-02 05:40:57 +0300
commitabb8ab84cd948edbe9e678aebbaa5a59681c5adc (patch)
tree1487cb3462b4aa5a0c8d91992c78d5e0ac08b75f /gn_auth
parent24bc0df2ae77867f80850ea52ff20736271f4b89 (diff)
downloadgn-auth-abb8ab84cd948edbe9e678aebbaa5a59681c5adc.tar.gz
use dataclasses' asdict() function.
Diffstat (limited to 'gn_auth')
-rw-r--r--gn_auth/auth/authorisation/users/admin/views.py3
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))