Continue Flask migration.
This commit is contained in:
parent
41d23b9bd8
commit
7c780d5c83
@ -195,11 +195,11 @@ class Set_mode_thermostat(Resource):
|
|||||||
return "K0", 400
|
return "K0", 400
|
||||||
try:
|
try:
|
||||||
db.session.add(data)
|
db.session.add(data)
|
||||||
except sqlite3.IntegrityError:
|
|
||||||
logging.error("catched")
|
|
||||||
try:
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return "OK", 201
|
return "OK", 201
|
||||||
|
except sqlite3.IntegrityError:
|
||||||
|
logging.error("catched")
|
||||||
|
return "K0", 400
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(e)
|
logging.error(e)
|
||||||
return "K0", 400
|
return "K0", 400
|
||||||
|
Loading…
Reference in New Issue
Block a user