switch to dataclass, cleanup

This commit is contained in:
2026-02-24 17:45:43 +01:00
parent 3970507239
commit 2257e08063
2 changed files with 6 additions and 4 deletions
+4 -3
View File
@@ -1,11 +1,12 @@
from dataclasses import dataclass
from typing import Optional
from app.db import get_db
from flask_login import UserMixin
@dataclass
class User(UserMixin):
def __init__(self, id: int, username: str ):
self.id: int = id
self.username: str = username
id: int
username: str
@staticmethod
def get(user_id: int | str) -> Optional["User"]: