Squashed commit of the following:
commit3627419e12Merge:2db744d3446ce9Author: alwayscompiling <[email protected]> Date: Tue Dec 6 22:36:51 2022 -0500 Merge branch '45-sql-connection-timing-out' into develop commit3446ce9ca2Author: alwayscompiling <[email protected]> Date: Tue Dec 6 22:27:05 2022 -0500 Change session usage to on use basis. commit2db744d170Author: alwayscompiling <[email protected]> Date: Sun Dec 4 21:44:54 2022 -0500 Add restart policy. commitfa33be1b4aAuthor: alwayscompiling <[email protected]> Date: Sun Dec 4 21:25:57 2022 -0500 Renamed docker compose file.
This commit is contained in:
+11
-9
@@ -6,9 +6,10 @@ from enum import Enum
|
||||
|
||||
from nextcord import Embed
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
# pylint: disable=import-error
|
||||
from utilities.sql_alchemy_connection import Category, CategoryGroup, session
|
||||
from utilities.sql_data_classes import Category, CategoryGroup, engine
|
||||
|
||||
|
||||
class SubmissionState(Enum):
|
||||
@@ -199,14 +200,15 @@ class Submission:
|
||||
.where(CategoryGroup.GuildId == self.guild_id)
|
||||
.where(CategoryGroup.GroupId == self.group_id)
|
||||
)
|
||||
embed.add_field(name="Group", value=session.scalar(stmt), inline=False)
|
||||
if self.category_id:
|
||||
stmt = (
|
||||
select(Category.CategoryName)
|
||||
.where(Category.GroupId == self.group_id)
|
||||
.where(Category.CategoryId == self.category_id)
|
||||
)
|
||||
embed.add_field(name="Category", value=session.scalar(stmt), inline=False)
|
||||
with Session(engine) as session:
|
||||
embed.add_field(name="Group", value=session.scalar(stmt), inline=False)
|
||||
if self.category_id:
|
||||
stmt = (
|
||||
select(Category.CategoryName)
|
||||
.where(Category.GroupId == self.group_id)
|
||||
.where(Category.CategoryId == self.category_id)
|
||||
)
|
||||
embed.add_field(name="Category", value=session.scalar(stmt), inline=False)
|
||||
if self.score:
|
||||
embed.add_field(name="Score", value=self.score, inline=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user