Adding language field to admin db and local variable

This commit is contained in:
adator
2025-08-25 23:22:50 +02:00
parent 0c6fcb7710
commit 25bbddf459
6 changed files with 41 additions and 17 deletions

View File

@@ -152,4 +152,20 @@ class Admin:
if record.uid == uidornickname:
return record.nickname
return None
return None
def get_language(self, uidornickname: str) -> Optional[str]:
"""Get the language of the admin
Args:
uidornickname (str): The user ID or the Nickname of the admin
Returns:
Optional[str]: The language selected by the admin.
"""
admin = self.get_admin(uidornickname)
if admin is None:
return None
return admin.language