From 8777c562dd6f43afbf0f647b8b969b8956604cf5 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Tue, 26 Mar 2024 21:18:03 +0100 Subject: [PATCH] Linting Signed-off-by: Emmy D'Anello --- draw/consumers.py | 6 ++---- participation/forms.py | 6 ++---- participation/models.py | 2 +- participation/tables.py | 2 +- participation/views.py | 2 -- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/draw/consumers.py b/draw/consumers.py index d9292d5..fdb921d 100644 --- a/draw/consumers.py +++ b/draw/consumers.py @@ -447,10 +447,8 @@ class DrawConsumer(AsyncJsonWebsocketConsumer): td2.passage_index = current_passage_index if len(round2_pools) == 1 and len(tds) == 5: # Exchange teams 1 and 5 if there is only one pool with 5 teams - if i == 0: - td2.passage_index = 4 - elif i == 4: - td2.passage_index = 0 + if i == 0 or i == 4: + td2.passage_index = 4 - i current_passage_index += 1 await td2.asave() diff --git a/participation/forms.py b/participation/forms.py index 41667ad..6b8627c 100644 --- a/participation/forms.py +++ b/participation/forms.py @@ -7,17 +7,15 @@ import re from typing import Iterable from crispy_forms.helper import FormHelper -from crispy_forms.layout import Div, Submit, Field +from crispy_forms.layout import Div, Field, Submit from django import forms from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.validators import FileExtensionValidator -from django.db.models import CharField, Value -from django.db.models.functions import Concat from django.utils.translation import gettext_lazy as _ from pypdf import PdfReader - from registration.models import VolunteerRegistration + from .models import Note, Participation, Passage, Pool, Solution, Synthesis, Team, Tournament diff --git a/participation/models.py b/participation/models.py index aebe02f..87451a9 100644 --- a/participation/models.py +++ b/participation/models.py @@ -8,7 +8,7 @@ from django.conf import settings from django.core.exceptions import ValidationError from django.core.validators import MaxValueValidator, MinValueValidator, RegexValidator from django.db import models -from django.db.models import F, Index, Q +from django.db.models import Index from django.urls import reverse_lazy from django.utils import timezone from django.utils.crypto import get_random_string diff --git a/participation/tables.py b/participation/tables.py index d64c2cd..4c87c95 100644 --- a/participation/tables.py +++ b/participation/tables.py @@ -1,6 +1,6 @@ # Copyright (C) 2020 by Animath # SPDX-License-Identifier: GPL-3.0-or-later -from django.urls import reverse_lazy + from django.utils import formats from django.utils.safestring import mark_safe from django.utils.text import format_lazy diff --git a/participation/views.py b/participation/views.py index 5eb8497..95d32f8 100644 --- a/participation/views.py +++ b/participation/views.py @@ -12,7 +12,6 @@ from zipfile import ZipFile from django.conf import settings from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin -from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.core.exceptions import PermissionDenied from django.core.mail import send_mail @@ -816,7 +815,6 @@ class PoolJuryView(VolunteerMixin, FormView, DetailView): form_class = AddJuryForm template_name = 'participation/pool_jury.html' - def dispatch(self, request, *args, **kwargs): self.object = self.get_object()