Skip to content

Commit

Permalink
Move price calcs to where they will be used
Browse files Browse the repository at this point in the history
Fixes #379
  • Loading branch information
hyanwong committed May 5, 2021
1 parent 037ddbe commit 4cc6f9d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions controllers/default.py
Expand Up @@ -332,11 +332,6 @@ def sponsor_leaf_check(use_form_data, form_data_to_db):
if maint:
status = "maintenance"

max_price = db.prices.price.max()
max_global_price = db().select(max_price).first()[max_price] / 100
min_price = db.prices.price.min()
min_global_price = db().select(min_price).first()[min_price] / 100

if (request.vars.get('form_reservation_code')):
form_reservation_code = request.vars.form_reservation_code
else:
Expand Down Expand Up @@ -665,6 +660,11 @@ def sponsor_leaf_check(use_form_data, form_data_to_db):
validated = False
else:
pass # Simply show the form

max_price = db.prices.price.max()
max_global_price = db().select(max_price).first()[max_price] / 100
min_price = db.prices.price.min()
min_global_price = db().select(min_price).first()[min_price] / 100
return dict(
form = form,
validated = validated,
Expand Down

0 comments on commit 4cc6f9d

Please sign in to comment.