custom urls

This commit is contained in:
cube
2026-05-30 01:50:56 +01:00
parent 4c3279ef29
commit bfbe54df03
6 changed files with 40 additions and 24 deletions

View File

@@ -83,10 +83,13 @@ def edit(mid):
edit_location = "details"
if "custom_url" in request.form:
custom_url = request.form["custom_url"]
custom_url = request.form["custom_url"].strip()
db.execute("UPDATE member SET custom_url=(?) WHERE id=(?)",(custom_url, mid))
db.commit()
try:
db.execute("UPDATE member SET custom_url=(?) WHERE id=(?)",(custom_url, mid))
db.commit()
except sqlite3.IntegrityError:
pass
edit_location="custom_url"
@@ -179,7 +182,15 @@ def edit(mid):
edit_location = "sections"
member = db.execute("SELECT * FROM member WHERE id=(?)",(mid,)).fetchone()
try:
member = db.execute("SELECT * FROM member WHERE id=(?)",(mid,)).fetchone()
except:
try:
member = db.execute("SELECT * FROM member WHERE custom_url=(?)",(mid,)).fetchone()
except:
return "Not Found <br> <a href='/'>Go Home</a>", 404
icons = db.execute("SELECT * FROM icons WHERE member_id=(?)",(mid,)).fetchall()
blinkies = db.execute("SELECT * FROM blinkies WHERE member_id=(?)",(mid,)).fetchall()
stamps = db.execute("SELECT * FROM stamps WHERE member_id=(?)",(mid,)).fetchall()