modified: app.py
This commit is contained in:
13
app.py
13
app.py
@@ -299,7 +299,7 @@ def user_dashboard(guild_id):
|
|||||||
connection = get_db_connection()
|
connection = get_db_connection()
|
||||||
cursor = connection.cursor(dictionary=True)
|
cursor = connection.cursor(dictionary=True)
|
||||||
|
|
||||||
# Überprüfe, ob der Benutzer Berechtigung für den Server hat
|
# Überprüfe, ob der Benutzer Mitglied des Servers (Gilde) ist
|
||||||
cursor.execute("SELECT * FROM user_data WHERE user_id = %s AND guild_id = %s", (user_id, guild_id))
|
cursor.execute("SELECT * FROM user_data WHERE user_id = %s AND guild_id = %s", (user_id, guild_id))
|
||||||
user_data = cursor.fetchone()
|
user_data = cursor.fetchone()
|
||||||
|
|
||||||
@@ -307,14 +307,17 @@ def user_dashboard(guild_id):
|
|||||||
connection.close()
|
connection.close()
|
||||||
|
|
||||||
if user_data:
|
if user_data:
|
||||||
g.user_data = user_data # Speichern der user_data in g
|
g.guild_id = guild_id # Setzt g.guild_id für die Navigation
|
||||||
g.guild_id = guild_id # Speichern der aktuellen guild_id in g
|
g.user_data = user_data
|
||||||
return render_template("user_dashboard.html")
|
return render_template("user_dashboard.html")
|
||||||
|
else:
|
||||||
|
flash("You do not have access to this server.", "danger")
|
||||||
|
return redirect(url_for("user_landing_page"))
|
||||||
|
|
||||||
# Weiterleitung zur Landing Page, falls keine Berechtigung oder Daten gefunden
|
flash("Please log in to view your dashboard.", "danger")
|
||||||
flash("You do not have access to this server or the server data was not found.", "warning")
|
|
||||||
return redirect(url_for("landing_page"))
|
return redirect(url_for("landing_page"))
|
||||||
|
|
||||||
|
|
||||||
@app.route("/server_giveaways/<int:guild_id>")
|
@app.route("/server_giveaways/<int:guild_id>")
|
||||||
def server_giveaways(guild_id):
|
def server_giveaways(guild_id):
|
||||||
"""Serverbasiertes Giveaway-Management"""
|
"""Serverbasiertes Giveaway-Management"""
|
||||||
|
|||||||
Reference in New Issue
Block a user