modified: app.py
This commit is contained in:
7
app.py
7
app.py
@@ -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>")
|
||||
|
||||
Reference in New Issue
Block a user