Browse Source

handle boudicca error; set font size

Bernadette Elena Hammerle 1 year ago
parent
commit
2b0df5b7b2
3 changed files with 7 additions and 2 deletions
  1. 1 0
      Dockerfile
  2. 5 2
      app.py
  3. 1 0
      static/css/main.css

+ 1 - 0
Dockerfile

@@ -1,4 +1,5 @@
 FROM docker.io/python:3.9.5
 RUN pip install flask==1.1.2
+RUN pip install requests==2.26.0
 COPY . /src/
 CMD ["python", "/src/app.py"]

+ 5 - 2
app.py

@@ -38,8 +38,11 @@ def steps():
 
 @app.route("/events", methods=["GET"])
 def events():
-    boudicca_events = requests.get("https://api.boudicca.events/event").json()
-    return render_template('events.html', events=boudicca_events)
+    boudicca_req = requests.get("https://api.boudicca.events/event")
+    events = []
+    if boudicca_req.status_code == 200:
+        events = boudicca_req.json()
+    return render_template('events.html', events=events)
 
 
 @app.route("/mitgestaltung", methods=["GET"])

+ 1 - 0
static/css/main.css

@@ -7,6 +7,7 @@
 
 body {
     background-color: var(--body-bg);
+    font-family: "Calibri";
 }
 
 .wrapper {