diff --git a/server.py b/server.py index 4084baeac..d407bbb08 100644 --- a/server.py +++ b/server.py @@ -46,6 +46,9 @@ def purchasePlaces(): competition = [c for c in competitions if c['name'] == request.form['competition']][0] club = [c for c in clubs if c['name'] == request.form['club']][0] placesRequired = int(request.form['places']) + if placesRequired > 12: + flash("you can not book more than 12 places") + return render_template('welcome.html', club=club, competitions=competitions) competition['numberOfPlaces'] = int(competition['numberOfPlaces'])-placesRequired flash('Great-booking complete!') return render_template('welcome.html', club=club, competitions=competitions) diff --git a/templates/booking.html b/templates/booking.html index 06ae1156c..1f0f01c62 100644 --- a/templates/booking.html +++ b/templates/booking.html @@ -10,7 +10,7 @@