V6.1.5 i forgot

This commit is contained in:
adator
2025-03-10 20:47:53 +01:00
parent befe452df8
commit 8cac3316fb
16 changed files with 755 additions and 187 deletions

View File

@@ -37,6 +37,9 @@ class Admin:
result = False
if not self.is_exist(uid):
return result
for record in self.UID_ADMIN_DB:
if record.uid == uid:
# If the admin exist, update and do not go further
@@ -46,7 +49,7 @@ class Admin:
return result
if not result:
self.Logs.critical(f'The new nickname {newNickname} was not updated, uid = {uid}')
self.Logs.critical(f'Admin: The new nickname {newNickname} was not updated, uid = {uid}')
return result
@@ -124,4 +127,18 @@ class Admin:
if record.uid == uidornickname:
nickname = record.nickname
self.Logs.debug(f'The value {uidornickname} -- {nickname}')
return nickname
return nickname
def is_exist(self, uidornickname: str) -> bool:
"""Check if this uid or nickname is logged in as an admin
Args:
uidornickname (str): The UID or the Nickname
Returns:
bool: True if the Nickname or UID is an admin
"""
if self.get_Admin(uidornickname) is None:
return False
else:
return True