Indent so that a command can properly use session.
Remove commented out code. Also add work to an issue.
This commit is contained in:
@@ -54,7 +54,6 @@ class SetCog(commands.Cog, name="Set command."):
|
||||
await interaction.response.send_message("Category or Group was not found.", ephemeral=True)
|
||||
return
|
||||
category.size = size
|
||||
# session.add(category) test if this is needed. SQLAlchemy can do the update without adding.
|
||||
session.commit()
|
||||
|
||||
# Use the relationship to get group category is in.
|
||||
@@ -101,7 +100,6 @@ class SetCog(commands.Cog, name="Set command."):
|
||||
await interaction.response.send_message("Category or Group was not found.", ephemeral=True)
|
||||
return
|
||||
category.is_ascending = ascending
|
||||
# session.add(category) test if this is needed. SQLAlchemy can do the update without adding.
|
||||
session.commit()
|
||||
|
||||
# Use the relationship to get group category is in.
|
||||
@@ -148,12 +146,11 @@ class SetCog(commands.Cog, name="Set command."):
|
||||
await interaction.response.send_message("Category or Group was not found.", ephemeral=True)
|
||||
return
|
||||
category.is_validated = validated
|
||||
# session.add(category) test if this is needed. SQLAlchemy can do the update without adding.
|
||||
session.commit()
|
||||
|
||||
await interaction.response.send_message(
|
||||
f"**{category.name}** is_validated has been updated to **{validated}**.", ephemeral=True
|
||||
)
|
||||
await interaction.response.send_message(
|
||||
f"**{category.name}** is_validated has been updated to **{validated}**.", ephemeral=True
|
||||
)
|
||||
|
||||
@category.subcommand(name="name", description="Change the name of a category.")
|
||||
async def category_name(
|
||||
@@ -184,7 +181,6 @@ class SetCog(commands.Cog, name="Set command."):
|
||||
return
|
||||
old_name = category.name
|
||||
category.name = name
|
||||
# session.add(category) test if this is needed. SQLAlchemy can do the update without adding.
|
||||
session.commit()
|
||||
|
||||
# Use the relationship to get group category is in.
|
||||
@@ -268,6 +264,9 @@ class SetCog(commands.Cog, name="Set command."):
|
||||
return
|
||||
group.channel_id = channel_id
|
||||
session.commit()
|
||||
# TODO(imcompiling): delete the message and call send_highscore_message to send a new one. Bug needs fixed
|
||||
# first.
|
||||
# 082
|
||||
await interaction.send(f"Registered <#{channel_id}>.", ephemeral=True)
|
||||
|
||||
@group.subcommand(
|
||||
|
||||
Reference in New Issue
Block a user