Skip to content

Commit

Permalink
actually subtract a hint when one is requested
Browse files Browse the repository at this point in the history
  • Loading branch information
Dillon Lareau committed Feb 5, 2020
1 parent fa8f9db commit 0da9318
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion huntserver/hunt_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from django.template.loader import render_to_string
from django.utils import timezone
from django.utils.encoding import smart_str
from django.db.models import F
import json
import os
import re
Expand Down Expand Up @@ -301,7 +302,8 @@ def puzzle_hint(request, puzzle_id):
if form.is_valid():
h = Hint.objects.create(request=form.cleaned_data['request'], puzzle=puzzle, team=team,
request_time=timezone.now(), last_modified_time=timezone.now())

team.num_available_hints = F('num_available_hints') - 1
team.save()
# Render response to HTML
hint_list = [render_to_string('hint_row.html', {'hint': h})]

Expand Down

0 comments on commit 0da9318

Please sign in to comment.