Skip to content

Commit

Permalink
fix python 3 int division bug in hint relase logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dlareau committed Nov 15, 2020
1 parent bc3e64f commit da1e694
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions huntserver/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def parse_attributes(META):


def check_hints(hunt):
num_min = (timezone.now() - hunt.start_date).seconds / 60
num_min = (timezone.now() - hunt.start_date).seconds // 60
for hup in hunt.hintunlockplan_set.exclude(unlock_type=HintUnlockPlan.SOLVES_UNLOCK):
if((hup.unlock_type == hup.TIMED_UNLOCK and
hup.num_triggered < 1 and num_min > hup.unlock_parameter) or
(hup.unlock_type == hup.INTERVAL_UNLOCK and
num_min / hup.unlock_parameter > hup.num_triggered)):
num_min // hup.unlock_parameter > hup.num_triggered)):
hunt.team_set.all().update(num_available_hints=F('num_available_hints') + 1)
hup.num_triggered = hup.num_triggered + 1
hup.save()
Expand Down

0 comments on commit da1e694

Please sign in to comment.