re-apply ruff TCH rules

This commit is contained in:
imperosol
2026-09-07 13:32:13 +02:00
parent d93afffbc3
commit 7bd79d1d55
63 changed files with 288 additions and 88 deletions
+5 -1
View File
@@ -13,6 +13,8 @@
#
#
from typing import TYPE_CHECKING
from django import forms
from django.conf import settings
from django.contrib.auth.mixins import PermissionRequiredMixin
@@ -22,7 +24,6 @@ from django.utils.translation import gettext_lazy as _
from django.views.generic import DetailView, ListView
from django.views.generic.edit import BaseFormView, UpdateView
from core.models import User
from counter.forms import CashSummaryFormBase
from counter.models import (
CashRegisterSummary,
@@ -35,6 +36,9 @@ from counter.views.mixins import (
CounterTabsMixin,
)
if TYPE_CHECKING:
from core.models import User
class CashRegisterSummaryForm(forms.Form):
"""Provide the cash summary form."""
+7 -3
View File
@@ -14,6 +14,7 @@
#
import random
from collections import defaultdict
from typing import TYPE_CHECKING
from django.contrib import messages
from django.core.exceptions import PermissionDenied
@@ -22,14 +23,11 @@ from django.db.models import Q
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect, resolve_url
from django.urls import reverse
from django.utils.safestring import SafeString
from django.utils.translation import gettext as _
from django.views.generic import CreateView, FormView
from django.views.generic.detail import SingleObjectMixin
from ninja.main import HttpRequest
from core.auth.mixins import CanViewMixin
from core.models import User
from core.views.mixins import FragmentMixin, UseFragmentsMixin
from counter.forms import BasketForm, RefillForm
from counter.models import (
@@ -44,6 +42,12 @@ from counter.utils import is_logged_in_counter
from counter.views.mixins import CounterTabsMixin
from counter.views.student_card import StudentCardFormFragment
if TYPE_CHECKING:
from django.utils.safestring import SafeString
from ninja.main import HttpRequest
from core.models import User
def get_operator(request: HttpRequest, counter: Counter, customer: Customer) -> User:
if counter.type != "BAR":
+4 -1
View File
@@ -13,6 +13,7 @@
#
#
from datetime import timedelta
from typing import TYPE_CHECKING
from django.conf import settings
from django.core.exceptions import PermissionDenied
@@ -21,7 +22,6 @@ from django.http import HttpRequest, HttpResponseRedirect
from django.shortcuts import redirect
from django.urls import reverse
from django.utils import timezone
from django.utils.safestring import SafeString
from django.views.decorators.http import require_POST
from django.views.generic import DetailView
from django.views.generic.detail import SingleObjectMixin
@@ -35,6 +35,9 @@ from counter.models import Counter, Permanency
from counter.utils import is_logged_in_counter
from counter.views.mixins import CounterTabsMixin
if TYPE_CHECKING:
from django.utils.safestring import SafeString
class CounterLoginFragment(FragmentMixin, SingleObjectMixin, FormView):
model = Counter
+5 -1
View File
@@ -13,11 +13,12 @@
#
#
from typing import TYPE_CHECKING
from django.core.exceptions import PermissionDenied
from django.http import Http404, HttpRequest, HttpResponse
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django.utils.safestring import SafeString
from django.utils.translation import gettext as _
from django.views.generic.edit import DeleteView, FormView
@@ -27,6 +28,9 @@ from counter.forms import StudentCardForm
from counter.models import Customer, StudentCard
from counter.utils import is_logged_in_counter
if TYPE_CHECKING:
from django.utils.safestring import SafeString
class StudentCardDeleteView(DeleteView):
"""View used to delete a card from a user. This is a fragment view !"""