Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Andgel committed Mar 17, 2022
1 parent 81e09c8 commit 4d7f375
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 int(club['points']) < placesRequired:
flash('You are not allowed to book more places than your amount of points')
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)
Expand Down

0 comments on commit 4d7f375

Please sign in to comment.