refactor1

This commit is contained in:
Andreas Stephanides
2017-08-28 09:08:47 +02:00
parent 699f4f6546
commit 630b982502
14 changed files with 274 additions and 230 deletions

View File

@@ -49,13 +49,16 @@ def store_value(id,key,value):
mth.opened=bool(value)
if key=="maintopic" and value in maintopic_values:
mth.maintopic=str(value)
if key=="lang" and value in maintopic_values:
if key=="lang" and value in ["de", "en"]:
mth.lang=str(value)
if key =="trained":
value = value in ["true", "True", "1", "t"]
mth.istrained=bool(value)
db_session.add(mth)
db_session.commit()
@app.route("/<int:id>")
def store_answered(id):