I think this was my first sql alchemy :), using much better DB .one() method

This commit is contained in:
2022-01-20 10:17:10 +11:00
parent fae1c0666d
commit 4b8beb766e

View File

@@ -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']