Skip to content

Commit

Permalink
Misc bug fixes
Browse files Browse the repository at this point in the history
Signed-off-by: tiksan <webmaster@deek.sh>
  • Loading branch information
dssecret committed Jan 5, 2025
1 parent 395c578 commit 518777d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion application/controllers/bot/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def notification_dashboard(guild_id: int):
)

if guild.notifications_config is None:
notifications_config: ServerNotificationsConfig = ServerNotificationsConfig.create()
notifications_config: ServerNotificationsConfig = ServerNotificationsConfig.create(server=guild.sid)
guild = (
Server.update(notifications_config=notifications_config._pk)
.where(Server.sid == guild_id)
Expand Down
3 changes: 3 additions & 0 deletions commons/tornium_commons/models/server_notifications_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@


class ServerNotificationsConfig(BaseModel):
class Meta:
table_name = "server_notifications_config"

server = DeferredForeignKey("server", null=False)
enabled = BooleanField(default=False, null=False)
log_channel = BigIntegerField(null=True)
3 changes: 1 addition & 2 deletions worker/lib/guild/schema/server_notifications_config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ defmodule Tornium.Schema.ServerNotificationsConfig do
}

@primary_key {:id, :id, autogenerate: true}
# schema "server_notifications_config" do
schema "servernotificationsconfig" do
schema "server_notifications_config" do
belongs_to(:server, Tornium.Schema.Server, references: :sid)

field(:enabled, :boolean)
Expand Down
2 changes: 1 addition & 1 deletion worker/lib/lua.ex
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ defmodule Tornium.Lua do
{:ok, {:error, :timeout}} ->
{:error, :timeout}

{:ok, {:error, {:lau_error, error, _state}}} ->
{:ok, {:error, {:lua_error, error, _state}}} ->
# TODO: Determine type of error for typespec
{:lua_error, error}

Expand Down

0 comments on commit 518777d

Please sign in to comment.