modified: app.py
This commit is contained in:
11
app.py
11
app.py
@@ -319,7 +319,6 @@ def server_admin_dashboard(guild_id):
|
||||
flash("You do not have permission to access this server's admin dashboard.", "danger")
|
||||
return redirect(url_for("user_landing_page"))
|
||||
|
||||
|
||||
@app.route("/ban_user/<int:guild_id>/<int:user_id>")
|
||||
def ban_user(guild_id, user_id):
|
||||
"""Banned einen Benutzer auf einem spezifischen Server."""
|
||||
@@ -495,22 +494,28 @@ def edit_giveaway(guild_id, uuid):
|
||||
return render_template("edit_giveaway.html", giveaway=giveaway, guild_id=guild_id)
|
||||
return redirect(url_for("landing_page"))
|
||||
|
||||
@app.route("/user_giveaways/<int:guild_id>")
|
||||
@app.route("/user_giveaways/<string:guild_id>")
|
||||
def user_giveaways(guild_id):
|
||||
"""Zeigt dem Benutzer die Giveaways an, die er auf einem bestimmten Server gewonnen hat."""
|
||||
if "discord_user" in session:
|
||||
user_info = session["discord_user"]
|
||||
user_id = user_info["id"]
|
||||
user_id = str(user_info["id"]) # Sicherstellen, dass user_id als String behandelt wird
|
||||
|
||||
connection = get_db_connection()
|
||||
cursor = connection.cursor(dictionary=True)
|
||||
|
||||
# Debugging-Ausgaben
|
||||
print(f"[DEBUG] Searching for giveaways with guild_id: {guild_id} and winner_dc_id: {user_id}")
|
||||
|
||||
# Suche nach Giveaways, bei denen der eingeloggte Benutzer der Gewinner ist
|
||||
cursor.execute("""
|
||||
SELECT * FROM giveaway_data WHERE winner_dc_id = %s AND guild_id = %s
|
||||
""", (user_id, guild_id))
|
||||
won_giveaways = cursor.fetchall()
|
||||
|
||||
# Debugging-Ausgabe für die abgerufenen Giveaways
|
||||
print(f"[DEBUG] Won giveaways retrieved: {won_giveaways}")
|
||||
|
||||
cursor.close()
|
||||
connection.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user