Remove another subquery. Enforce username length.

This commit is contained in:
alwayscompiling
2022-12-02 20:41:10 -05:00
parent f1cbe81699
commit 8624285d09
2 changed files with 3 additions and 2 deletions
@@ -54,7 +54,7 @@ class UpdateUsernameVerifyView(nextcord.ui.View):
score.UserName = new_username
session.commit()
group_ids = select(Category.GroupId).where(Category.CategoryId.in_(category_ids)).subquery()
group_ids = select(Category.GroupId).where(Category.CategoryId.in_(category_ids))
stmt = select(CategoryGroup).where(CategoryGroup.GroupId.in_(group_ids))
+2 -1
View File
@@ -226,7 +226,8 @@ def format_highscore_message(group: CategoryGroup) -> str:
# add each score to list
for ind in range(max_cat_size): # need to subtract to deal with category name string
if ind in processed_group.index:
username = processed_group["UserName"][ind].ljust(guild.UsernameLength, " ")
user_length = guild.UsernameLength
username = processed_group["UserName"][ind][:user_length].ljust(user_length, " ")
# get score, pad to correct length
if category.IsTimeRecord: