I think this was my first sql alchemy :), using much better DB .one() method
This commit is contained in:
@@ -96,11 +96,8 @@ def settings():
|
|||||||
|
|
||||||
if request.method == 'POST' and form.validate():
|
if request.method == 'POST' and form.validate():
|
||||||
try:
|
try:
|
||||||
# HACK, I don't really need an id here, but sqlalchemy get weird
|
|
||||||
# without one, so just grab the id of the only row there, it will
|
s = Settings.query.one()
|
||||||
# do...
|
|
||||||
id = Settings.query.all()[0].id
|
|
||||||
s = Settings.query.get(id)
|
|
||||||
if 'submit' in request.form:
|
if 'submit' in request.form:
|
||||||
st.SetMessage("Successfully Updated Settings" )
|
st.SetMessage("Successfully Updated Settings" )
|
||||||
s.import_path = request.form['import_path']
|
s.import_path = request.form['import_path']
|
||||||
|
|||||||
Reference in New Issue
Block a user