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():
|
||||
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
|
||||
# do...
|
||||
id = Settings.query.all()[0].id
|
||||
s = Settings.query.get(id)
|
||||
|
||||
s = Settings.query.one()
|
||||
if 'submit' in request.form:
|
||||
st.SetMessage("Successfully Updated Settings" )
|
||||
s.import_path = request.form['import_path']
|
||||
|
||||
Reference in New Issue
Block a user