|
|
@@ -17,21 +17,10 @@ def new():
|
|
17
|
17
|
bio = request.form['bio']
|
|
18
|
18
|
user_id = g.user[0]
|
|
19
|
19
|
db = get_db()
|
|
20
|
|
- error = None
|
|
21
|
|
-
|
|
22
|
|
- if not name:
|
|
23
|
|
- error = 'Name is required.'
|
|
24
|
|
-
|
|
25
|
|
- if error is None:
|
|
26
|
|
- db.execute(
|
|
27
|
|
- "INSERT INTO member (user_id, member_name, bio) VALUES (?, ?, ?)",
|
|
28
|
|
- (user_id, name, bio),
|
|
29
|
|
-
|
|
30
|
|
- )
|
|
31
|
|
- db.commit()
|
|
32
|
|
- return redirect(url_for('home.full_list'))
|
|
33
|
|
-
|
|
34
|
|
- return render_template('manage/new.html', error=error)
|
|
|
20
|
+
|
|
|
21
|
+ db.execute("INSERT INTO member (user_id, member_name, bio) VALUES (?, ?, ?)",(user_id, name, bio))
|
|
|
22
|
+ db.commit()
|
|
|
23
|
+ return redirect(url_for('home.full_list'))
|
|
35
|
24
|
|
|
36
|
25
|
return render_template('manage/new.html')
|
|
37
|
26
|
|
|
|
@@ -58,15 +47,6 @@ def edit(mid):
|
|
58
|
47
|
db.execute("INSERT INTO icons (member_id, icon_location) VALUES (?, ?)", (mid, filename),)
|
|
59
|
48
|
db.commit()
|
|
60
|
49
|
|
|
61
|
|
- # this specific chunk here is checking whether icons in the myriad/static/icons folder have a link in the database
|
|
62
|
|
- # in case the database was rebuilt, or something else happened, it is a waste of storage keeping an unlinked image
|
|
63
|
|
-
|
|
64
|
|
-
|
|
65
|
|
- # and now for the same in reverse - clean the database of references to images that don't exist
|
|
66
|
|
-
|
|
67
|
|
-
|
|
68
|
|
- # the above cleanup operations should be a button in the manage sidebar but for now they are here.
|
|
69
|
|
-
|
|
70
|
50
|
if "c9" in request.form:
|
|
71
|
51
|
c9 = request.form["c9"]
|
|
72
|
52
|
c10 = request.form["c10"]
|
|
|
@@ -76,10 +56,6 @@ def edit(mid):
|
|
76
|
56
|
c14 = request.form["c14"]
|
|
77
|
57
|
c15 = request.form["c15"]
|
|
78
|
58
|
c16 = request.form["c16"]
|
|
79
|
|
- #c17 = request.form["c17"]
|
|
80
|
|
- #c18 = request.form["c18"]
|
|
81
|
|
- #c19 = request.form["c19"]
|
|
82
|
|
- #c20 = request.form["c20"]
|
|
83
|
59
|
c21 = request.form["c21"]
|
|
84
|
60
|
c22 = request.form["c22"]
|
|
85
|
61
|
|