Skip to content

Commit

Permalink
v1.02
Browse files Browse the repository at this point in the history
  • Loading branch information
Tzesh committed Jun 12, 2021
1 parent 8601797 commit d85774f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion denpointment.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,11 +544,12 @@ def book_an_appointment():
cursor = mysql.connection.cursor()
dentist_id = form.dentist.data
date = form.date.data
hour = form.hour.data
today = datetime.today()
if today.year != date.year or today.month != date.month or today.day > date.day:
flash(message="You only can get an appointment for this month.", category="danger")
return redirect(url_for("book_an_appointment"))
if today.year == date.year and today.month == date.month and today.day == date.day and datetime.now().hour > date.hour:
if today.year == date.year and today.month == date.month and today.day == date.day and datetime.now().hour > int(hour):
flash(message="You cannot get an appointment for a past time.", category="danger")
return redirect(url_for("book_an_appointment"))
day = str(date.day).zfill(2)
Expand Down

0 comments on commit d85774f

Please sign in to comment.