Skip to content

Commit

Permalink
Fix notification bot API endpoints
Browse files Browse the repository at this point in the history
Signed-off-by: tiksan <[email protected]>
  • Loading branch information
dssecret committed Jan 10, 2025
1 parent 518777d commit 8691481
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions application/controllers/api/v1/bot/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ def toggle_notifications(guild_id: int, *args, **kwargs):
return make_exception_response("1000", key, details={"message": "Invalid enabled value"})

try:
guild: Server = Server.select(Server.admins).where(Server.sid == guild_id).get()
guild: Server = (
Server.select(Server.admins, Server.notifications_config)
.where(Server.sid == guild_id)
.get()
)
except DoesNotExist:
return make_exception_response("1001", key)

Expand All @@ -90,7 +94,11 @@ def set_notifications_log_channel(guild_id: int, *args, **kwargs):
return make_exception_response("1001", key)

try:
guild: Server = Server.select(Server.admins).where(Server.sid == guild_id).get()
guild: Server = (
Server.select(Server.admins, Server.notifications_config)
.where(Server.sid == guild_id)
.get()
)
except DoesNotExist:
return make_exception_response("1001", key)

Expand Down
2 changes: 1 addition & 1 deletion application/templates/bot/notification.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{% endblock %}

{% block subnav %}
<div class="row pt-3 border-top">
<div class="row pt-3 border-top">
<div class="container-fluid px-md-3">
<div class="row mb-3">
<a class="nav-link" href="/bot/dashboard">
Expand Down

0 comments on commit 8691481

Please sign in to comment.