This commit is contained in:
Alexander Kalinovsky
2025-02-01 20:21:55 +01:00
parent a22ab9b0de
commit 1ca90c633f
6 changed files with 16 additions and 9 deletions

View File

@@ -20,5 +20,5 @@ class I18nMiddleware(SimpleI18nMiddleware):
if db_session and event.model_fields.get("from_user"):
user = await self.user_class.get(id=event.from_user.id, session=db_session)
if user and user.lang:
return user.lang
return user.lang.value
return await super().get_locale(event=event, data=data)