From 276da56fdb6fd12850a2edfba7da7ec17523ba67 Mon Sep 17 00:00:00 2001 From: SimolZimol <70102430+SimolZimol@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:00:38 +0100 Subject: [PATCH] modified: app.py modified: templates/user_giveaways.html --- app.py | 7 ++++++- templates/user_giveaways.html | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index bd6b0ef..7e979c4 100644 --- a/app.py +++ b/app.py @@ -510,10 +510,15 @@ def user_giveaways(guild_id): """, (user_id, guild_id)) won_giveaways = cursor.fetchall() + # Hole den Servernamen aus der guilds-Tabelle + cursor.execute("SELECT name FROM guilds WHERE guild_id = %s", (guild_id,)) + guild_name_result = cursor.fetchone() + guild_name = guild_name_result["name"] if guild_name_result else f"Server {guild_id}" + cursor.close() connection.close() - return render_template("user_giveaways.html", won_giveaways=won_giveaways, guild_id=guild_id) + return render_template("user_giveaways.html", won_giveaways=won_giveaways, guild_id=guild_id, guild_name=guild_name) return redirect(url_for("landing_page")) diff --git a/templates/user_giveaways.html b/templates/user_giveaways.html index 781902a..a796651 100644 --- a/templates/user_giveaways.html +++ b/templates/user_giveaways.html @@ -3,7 +3,7 @@ - Your Won Giveaways + Your Won Giveaways - {{ guild_name }}