fix #15 REQUIRES DB INIT
This commit is contained in:
@@ -80,7 +80,19 @@ def edit(mid):
|
||||
db.execute("UPDATE member SET member_name=(?), bio=(?), subtitle=(?), public=(?), theme=(?) WHERE id=(?)",(name, bio, subtitle, privacy, theme, mid))
|
||||
db.commit()
|
||||
|
||||
edit_location="details"
|
||||
edit_location = "details"
|
||||
|
||||
if "page_settings" in request.form:
|
||||
show_groups = "show_groups" in request.form
|
||||
show_blog = "show_blog" in request.form
|
||||
show_icons = "show_icons" in request.form
|
||||
show_blinkies = "show_blinkies" in request.form
|
||||
show_stamps = "show_stamps" in request.form
|
||||
|
||||
db.execute("UPDATE member SET show_groups=(?), show_blog=(?), show_icons=(?), show_blinkies=(?), show_stamps=(?) WHERE id=(?)",(show_groups, show_blog, show_icons, show_blinkies, show_stamps, mid))
|
||||
db.commit()
|
||||
|
||||
edit_location = "page_settings"
|
||||
|
||||
if "file" in request.files:
|
||||
# here we are just saving the uploaded file to the icons folder.
|
||||
@@ -92,21 +104,21 @@ def edit(mid):
|
||||
db.execute("INSERT INTO icons (member_id, icon_location) VALUES (?, ?)", (mid, filename))
|
||||
db.commit()
|
||||
|
||||
edit_location="icons"
|
||||
edit_location = "icons"
|
||||
|
||||
if "gid_add" in request.form:
|
||||
gid = request.form["gid_add"]
|
||||
db.execute("INSERT INTO group_members (group_id,member_id) VALUES (?,?)",(gid,mid))
|
||||
db.commit()
|
||||
|
||||
edit_location="groups"
|
||||
edit_location = "groups"
|
||||
|
||||
elif "gid_remove" in request.form:
|
||||
gid = request.form["gid_remove"]
|
||||
db.execute("DELETE FROM group_members WHERE group_id=(?) AND member_id=(?)",(gid,mid))
|
||||
db.commit()
|
||||
|
||||
edit_location="groups"
|
||||
edit_location = "groups"
|
||||
|
||||
if "blinkie" in request.files:
|
||||
file = request.files["blinkie"]
|
||||
@@ -115,7 +127,7 @@ def edit(mid):
|
||||
db.execute("INSERT INTO blinkies (member_id, blinkie_location) VALUES (?, ?)", (mid, filename))
|
||||
db.commit()
|
||||
|
||||
edit_location="blinkies"
|
||||
edit_location = "blinkies"
|
||||
|
||||
if "stamp" in request.files:
|
||||
file = request.files["stamp"]
|
||||
@@ -124,7 +136,7 @@ def edit(mid):
|
||||
db.execute("INSERT INTO stamps (member_id, stamp_location) VALUES (?, ?)", (mid, filename))
|
||||
db.commit()
|
||||
|
||||
edit_location="stamps"
|
||||
edit_location = "stamps"
|
||||
|
||||
|
||||
member = db.execute("SELECT * FROM member WHERE id=(?)",(mid,)).fetchone()
|
||||
|
||||
Reference in New Issue
Block a user