Skip to content

Commit

Permalink
fix change to list
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLovesDoggo committed Dec 4, 2023
1 parent 56ec5cd commit a479ae5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/views/qr.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ def qr_first(request):
def qr_current(request):
i = request.user.team.current_qr_i
context = dict(first=i == 0, current=True)
context["qr"] = codes = QrCode.codes(request.user.team)[request.user.team.current_qr_i]
codes = QrCode.codes(request.user.team)
context["qr"] = codes[i]
context["nextqr"] = (
None if codes.count() <= (j := i + 1) else codes[j]
None if len(codes) <= (j := i + 1) else codes[j]
)
context["logic_hint"] = LogicPuzzleHint.get_clue(request.user.team)
return render(request, "core/qr.html", context=context)
Expand All @@ -159,7 +160,7 @@ def qr_current(request):
def qr_catalog(request):
i = request.user.team.current_qr_i
context = dict(first=i == 0, current=True)
context["qr"] = QrCode.codes(request.user.team)[: request.user.team.current_qr_i]
context["qr"] = QrCode.codes(request.user.team).all()[: request.user.team.current_qr_i]
return render(request, "core/qr_catalog.html", context=context)


Expand Down

0 comments on commit a479ae5

Please sign in to comment.