From 3a9bc22c60f6e2e85a9540991cd709536535a949 Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Fri, 19 Oct 2018 04:45:14 -0300 Subject: [PATCH] guilds: set message_notifications = guilds.default_message_notifications --- litecord/blueprints/guilds.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/litecord/blueprints/guilds.py b/litecord/blueprints/guilds.py index b7967d9..d43b033 100644 --- a/litecord/blueprints/guilds.py +++ b/litecord/blueprints/guilds.py @@ -35,6 +35,18 @@ async def create_guild_settings(guild_id: int, user_id: int): VALUES ($1, $2) """, user_id, guild_id) + m_notifs = await app.db.fetchval(""" + SELECT default_message_notifications + FROM guilds + WHERE id = $1 + """, guild_id) + + await app.db.execute(""" + UPDATE guild_settings + SET message_notifications = $1 + WHERE user_id = $2 AND guild_id = $3 + """, m_notifs, user_id, guild_id) + @bp.route('', methods=['POST']) async def create_guild():