Should have handled username updating code in the command, didn't need to create new functions for the command.

This commit is contained in:
alwayscompiling
2022-08-13 21:26:50 -04:00
parent 73e350c845
commit 652533d071
5 changed files with 24 additions and 84 deletions
-21
View File
@@ -162,24 +162,3 @@ class Table:
str: string of json representation of Table
"""
return json.dumps(self.to_dict(), indent=4)
def update_username(self, old_username: str, new_username: str) -> bool:
"""
Calls Category update_username function for each category. Returns true if a category
was updated to inform if the table message needs rewritten.
Args:
old_username (str): Username to replace. Sent to Category function
new_username (str): Username to replace with. Sent to Category function
Returns:
bool: True if category was updated and requires message update
"""
ret_val: bool = False
for category in self.categories:
if category.update_username(old_username, new_username):
ret_val = True
return ret_val