Database changes, new translations #32

Merged
profitroll merged 50 commits from dev into main 2023-11-05 15:37:22 +02:00
Showing only changes of commit b0f76f4c49 - Show all commits

View File

@ -71,6 +71,15 @@ class PyroUser:
return cls(**db_entry)
@classmethod
async def from_dict(cls, **kwargs):
if "location" in kwargs:
try:
kwargs["location"] = await Location.get(kwargs["location"]) # type: ignore
except ValueError:
kwargs["location"] = None # type: ignore
return cls(**kwargs)
async def update_locale(self, locale: Union[str, None]) -> None:
"""Change user's locale stored in the database.