Remove another subquery. Enforce username length.
This commit is contained in:
@@ -54,7 +54,7 @@ class UpdateUsernameVerifyView(nextcord.ui.View):
|
|||||||
score.UserName = new_username
|
score.UserName = new_username
|
||||||
session.commit()
|
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))
|
stmt = select(CategoryGroup).where(CategoryGroup.GroupId.in_(group_ids))
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -226,7 +226,8 @@ def format_highscore_message(group: CategoryGroup) -> str:
|
|||||||
# add each score to list
|
# add each score to list
|
||||||
for ind in range(max_cat_size): # need to subtract to deal with category name string
|
for ind in range(max_cat_size): # need to subtract to deal with category name string
|
||||||
if ind in processed_group.index:
|
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
|
# get score, pad to correct length
|
||||||
if category.IsTimeRecord:
|
if category.IsTimeRecord:
|
||||||
|
|||||||
Reference in New Issue
Block a user