fix #43
This commit is contained in:
@@ -11,11 +11,6 @@ def create_app(test_config=None):
|
||||
|
||||
# ensure the instance folder exists
|
||||
os.makedirs(app.instance_path, exist_ok=True)
|
||||
os.makedirs(app.ICON_UPLOAD_FOLDER, exist_ok=True)
|
||||
os.makedirs(app.BLINKIES_UPLOAD_FOLDER, exist_ok=True)
|
||||
os.makedirs(app.STAMPS_UPLOAD_FOLDER, exist_ok=True)
|
||||
os.makedirs(app.THEMES_FOLDER, exist_ok=True)
|
||||
os.makedirs(app.TMP_FOLDER, exist_ok=True)
|
||||
|
||||
from . import db
|
||||
db.init_app(app)
|
||||
|
||||
@@ -13,11 +13,12 @@ bp = Blueprint('manage', __name__, url_prefix='/manage')
|
||||
def new():
|
||||
if request.method == 'POST':
|
||||
name = request.form['name']
|
||||
subtitle = request.form["subtitle"]
|
||||
bio = request.form['bio']
|
||||
user_id = g.user[0]
|
||||
db = get_db()
|
||||
|
||||
db.execute("INSERT INTO member (user_id, member_name, bio) VALUES (?, ?, ?)",(user_id, name, bio))
|
||||
db.execute("INSERT INTO member (user_id, member_name, bio, subtitle) VALUES (?, ?, ?, ?)",(user_id, name, bio, subtitle))
|
||||
db.commit()
|
||||
return redirect(url_for('home.full_list'))
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
<form method="post">
|
||||
<label for="name">Name</label>
|
||||
<input name="name" id="name" required><br>
|
||||
<label for="subtitle">Subtitle</label>
|
||||
<input name="subtitle" id="subtitle"><br>
|
||||
<label for="bio">Description</label>
|
||||
<textarea name="bio" id="bio"></textarea><br>
|
||||
<input type="submit" value="Submit">
|
||||
|
||||
Reference in New Issue
Block a user