From 86348fc54e3f932df535fee59ef94edb5024d550 Mon Sep 17 00:00:00 2001 From: James Turk Date: Sat, 5 Jun 2021 01:35:56 -0400 Subject: [PATCH] 404 --- app.py | 5 +++++ data/employees.csv | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 10ca127..e9be264 100644 --- a/app.py +++ b/app.py @@ -47,6 +47,11 @@ def staff(): @app.route("/staff/") def staff_detail(id_): + if id_ == "404": + abort( + 404, + "This page intentionally left blank. (No really! This is an intentional error for demonstration purposes.)", + ) if employee := employees().get(id_): return render_template("staff_detail.html", employee=employee) else: diff --git a/data/employees.csv b/data/employees.csv index f7068c6..2c6a73e 100644 --- a/data/employees.csv +++ b/data/employees.csv @@ -14,7 +14,7 @@ id,first,last,position,status,children,hired 23,John,Grim,Actuary,Married,1.8,9/9/1970 24,John,Guardian,Optical Systems Engineer,Single,0,6/9/1980 25,John,Icicle Boy,Refrigeration R&D,Single,0,2/6/1939 -26,John,Jones,Government Relations,Married,3,8/15/1984 +404,John,Jones,Government Relations,Married,3,8/15/1984 27,John,Joseph,Government Relations,Married,2,10/31/1938 28,John,Kim Chi,Craft Services,Married,2,7/24/1990 29,John,Lee,Accounting,Single,0,12/14/1988