diff --git a/core/models.py b/core/models.py index 589c1b3..aae8ec1 100644 --- a/core/models.py +++ b/core/models.py @@ -77,7 +77,9 @@ def __str__(self): return f"{self.id} {self.short or self.location}" @classmethod - def codes(cls, team: "Team") -> List[QrCode]: # todo: have this return an ordered QuerySet instead of a list + def codes( + cls, team: "Team" + ) -> List[QrCode]: # todo: have this return an ordered QuerySet instead of a list pks = QrCode.code_pks(team) return [QrCode.objects.get(id=a) for a in pks] diff --git a/core/views/qr.py b/core/views/qr.py index ff08d0d..6e54c5c 100644 --- a/core/views/qr.py +++ b/core/views/qr.py @@ -161,9 +161,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)[: request.user.team.current_qr_i] return render(request, "core/qr_catalog.html", context=context)