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)
|
await interaction.response.send_message("Category or Group was not found.", ephemeral=True)
|
||||||
return
|
return
|
||||||
category.size = size
|
category.size = size
|
||||||
# session.add(category) test if this is needed. SQLAlchemy can do the update without adding.
|
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
# Use the relationship to get group category is in.
|
# 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)
|
await interaction.response.send_message("Category or Group was not found.", ephemeral=True)
|
||||||
return
|
return
|
||||||
category.is_ascending = ascending
|
category.is_ascending = ascending
|
||||||
# session.add(category) test if this is needed. SQLAlchemy can do the update without adding.
|
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
# Use the relationship to get group category is in.
|
# Use the relationship to get group category is in.
|
||||||
@@ -148,7 +146,6 @@ class SetCog(commands.Cog, name="Set command."):
|
|||||||
await interaction.response.send_message("Category or Group was not found.", ephemeral=True)
|
await interaction.response.send_message("Category or Group was not found.", ephemeral=True)
|
||||||
return
|
return
|
||||||
category.is_validated = validated
|
category.is_validated = validated
|
||||||
# session.add(category) test if this is needed. SQLAlchemy can do the update without adding.
|
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
await interaction.response.send_message(
|
await interaction.response.send_message(
|
||||||
@@ -184,7 +181,6 @@ class SetCog(commands.Cog, name="Set command."):
|
|||||||
return
|
return
|
||||||
old_name = category.name
|
old_name = category.name
|
||||||
category.name = name
|
category.name = name
|
||||||
# session.add(category) test if this is needed. SQLAlchemy can do the update without adding.
|
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
# Use the relationship to get group category is in.
|
# Use the relationship to get group category is in.
|
||||||
@@ -268,6 +264,9 @@ class SetCog(commands.Cog, name="Set command."):
|
|||||||
return
|
return
|
||||||
group.channel_id = channel_id
|
group.channel_id = channel_id
|
||||||
session.commit()
|
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)
|
await interaction.send(f"Registered <#{channel_id}>.", ephemeral=True)
|
||||||
|
|
||||||
@group.subcommand(
|
@group.subcommand(
|
||||||
|
|||||||
Reference in New Issue
Block a user