Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

Commit

Permalink
Update Fix OpenClassrooms-Student-Center#5 OpenClassrooms-Student-Cen…
Browse files Browse the repository at this point in the history
…ter/Python_Testing
  • Loading branch information
josayko committed Apr 19, 2022
1 parent 76abdb3 commit 22aadfb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
from flask import Flask, render_template, request, redirect, flash, url_for
from datetime import datetime, date

CLUBS_DATA = "clubs.json"
COMPETITIONS_DATA = "competitions.json"
# CLUBS_DATA = "clubs.json"
# COMPETITIONS_DATA = "competitions.json"

# CLUBS_DATA = "tests/mock_clubs.json"
# COMPETITIONS_DATA = "tests/mock_competitions.json"
CLUBS_DATA = "tests/mock_clubs.json"
COMPETITIONS_DATA = "tests/mock_competitions.json"


def loadClubs():
Expand Down Expand Up @@ -55,7 +55,9 @@ def book(competition, club):
if competition_date < datetime.now():
flash("Error: can not purchase a place for past competitions")
return (
render_template("welcome.html", club=club, competitions=competitions),
render_template(
"welcome.html", club=foundClub, competitions=competitions
),
400,
)

Expand All @@ -65,7 +67,7 @@ def book(competition, club):
else:
flash("Something went wrong-please try again")
return (
render_template("welcome.html", club=club, competitions=competitions),
render_template("welcome.html", club=foundClub, competitions=competitions),
400,
)

Expand Down

0 comments on commit 22aadfb

Please sign in to comment.