From 9b33654fe6764732367bf90d947612f704bf6b9a Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Sat, 1 Jun 2024 23:42:54 +0200 Subject: [PATCH] Add missing variable. Fix syntax. --- Dockerfile | 1 + thermostat.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ed4bdb0..94f1a14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,4 +9,5 @@ WORKDIR /root COPY thermostat.py /root/ COPY migrate_db.sh /root/ COPY entrypoint.sh /root/ +ENV FLASK_APP thermostat.py ENTRYPOINT ["/root/entrypoint.sh"] diff --git a/thermostat.py b/thermostat.py index 43733b2..4a28e37 100644 --- a/thermostat.py +++ b/thermostat.py @@ -76,7 +76,7 @@ class Set_mode(db.Model): __tablename__ = "set_mode" name = db.Column(db.String, primary_key=True, server_default='mode', nullable=False) value = db.Column(db.String, nullable=False) - timestamp = db.Column(db.DateTime, server_default=text("CURRENT_TIMESTAMP"), nullable=False) + timestamp = db.Column(db.DateTime, server_default=db.text("CURRENT_TIMESTAMP"), nullable=False) Set_mode_resource_fields = { 'name': fields.String(description='mode type'),