Skip to content

Commit

Permalink
start_day redirects to students if none in the DB
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyneira committed Sep 5, 2017
1 parent 8cfc78a commit eccaeb2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eccaeb2

Please sign in to comment.