fix: E-Mail wird als bytes statt str angezeigt (b'...' in der Navbar)

_row_to_user() dekodierte bislang nur hashed_password von bytes zu str,
obwohl psycopg dieselbe Eigenart (TEXT-Spalte kommt teils als bytes
zurück) auch bei email zeigt. Sichtbar z.B. im Header als
b'name@domain.tld' statt name@domain.tld.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Thomas Stallinger 2026-08-10 13:53:33 +02:00
parent dd12dd7b74
commit af6e93067f

View File

@ -44,6 +44,8 @@ def _row_to_user(row) -> User:
# psycopg liefert TEXT-Spalten hier teils als bytes zurück, nicht als str. # psycopg liefert TEXT-Spalten hier teils als bytes zurück, nicht als str.
if isinstance(hashed_password, bytes): if isinstance(hashed_password, bytes):
hashed_password = hashed_password.decode("utf-8") hashed_password = hashed_password.decode("utf-8")
if isinstance(email, bytes):
email = email.decode("utf-8")
return User( return User(
id=user_id, id=user_id,