Database changes, new translations #32
@ -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.
|
||||
|
||||
|
Reference in New Issue
Block a user