modified: app.py

This commit is contained in:
SimolZimol
2024-10-25 16:08:38 +02:00
parent 3c78913f56
commit 1f2978bd3c

7
app.py
View File

@@ -299,6 +299,7 @@ def user_dashboard(guild_id):
connection = get_db_connection()
cursor = connection.cursor(dictionary=True)
# Überprüfe, ob der Benutzer Berechtigung für den Server hat
cursor.execute("SELECT * FROM user_data WHERE user_id = %s AND guild_id = %s", (user_id, guild_id))
user_data = cursor.fetchone()
@@ -306,8 +307,12 @@ def user_dashboard(guild_id):
connection.close()
if user_data:
return render_template("user_dashboard.html", user_info=g.user_info, user_data=user_data, guild_id=guild_id)
g.user_data = user_data # Speichern der user_data in g
g.guild_id = guild_id # Speichern der aktuellen guild_id in g
return render_template("user_dashboard.html")
# Weiterleitung zur Landing Page, falls keine Berechtigung oder Daten gefunden
flash("You do not have access to this server or the server data was not found.", "warning")
return redirect(url_for("landing_page"))
@app.route("/server_giveaways/<int:guild_id>")