From eccaeb2b2aed0fd9738d83a118cadb5e4efcc289 Mon Sep 17 00:00:00 2001 From: Danny Neira Date: Tue, 5 Sep 2017 12:01:50 -0400 Subject: [PATCH] start_day redirects to students if none in the DB --- main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.py b/main.py index edccd13..0609bb3 100644 --- a/main.py +++ b/main.py @@ -152,6 +152,9 @@ def start_day(): students_att = Attendance.query.filter_by(date_now = date.today()).all() # checks if not attendace list has been created for the day. + if not students: + flash('No students in the database yet', 'error') + return redirect('/students') if not students_att: if students: # pushes all students into the attendance table, creating