This commit is contained in:
Yohann D'ANELLO 2021-01-17 16:23:48 +01:00
parent 9b5ad96aaa
commit daac77ba57
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
7 changed files with 15 additions and 18 deletions

View File

@ -9,7 +9,7 @@ from django.core.exceptions import ValidationError
from django.utils import formats
from django.utils.translation import gettext_lazy as _
from .models import Note, Participation, Passage, Pool, Team, Tournament, Solution, Synthesis
from .models import Note, Participation, Passage, Pool, Solution, Synthesis, Team, Tournament
class TeamForm(forms.ModelForm):

View File

@ -71,4 +71,4 @@ class Command(BaseCommand):
sympa.subscribe(volunteer.user.email, f"jurys-{slug}", True)
for admin in AdminRegistration.objects.all():
sympa.subscribe(admin.user.email, f"admins", True)
sympa.subscribe(admin.user.email, "admins", True)

View File

@ -4,12 +4,11 @@
from django.urls import path
from django.views.generic import TemplateView
from .views import CreateTeamView, JoinTeamView, \
MyParticipationDetailView, MyTeamDetailView, NoteUpdateView, ParticipationDetailView, \
PassageCreateView, PassageDetailView, PassageUpdateView, PoolCreateView, PoolDetailView, \
PoolUpdateView, PoolUpdateTeamsView, TeamAuthorizationsView, TeamDetailView, TeamLeaveView, TeamListView, \
TeamUpdateView, TournamentCreateView, TournamentDetailView, TournamentListView, TournamentUpdateView, \
SolutionUploadView, SynthesisUploadView
from .views import CreateTeamView, JoinTeamView, MyParticipationDetailView, MyTeamDetailView, NoteUpdateView, \
ParticipationDetailView, PassageCreateView, PassageDetailView, PassageUpdateView, PoolCreateView, PoolDetailView, \
PoolUpdateTeamsView, PoolUpdateView, SolutionUploadView, SynthesisUploadView, TeamAuthorizationsView, \
TeamDetailView, TeamLeaveView, TeamListView, TeamUpdateView, TournamentCreateView, TournamentDetailView, \
TournamentListView, TournamentUpdateView
app_name = "participation"

View File

@ -9,7 +9,7 @@ from django.contrib.sites.models import Site
from django.core.exceptions import PermissionDenied
from django.core.mail import send_mail
from django.db import transaction
from django.http import HttpResponse, Http404
from django.http import Http404, HttpResponse
from django.shortcuts import redirect
from django.template.loader import render_to_string
from django.urls import reverse_lazy
@ -24,9 +24,9 @@ from tfjm.matrix import Matrix
from tfjm.views import AdminMixin, VolunteerMixin
from .forms import JoinTeamForm, NoteForm, ParticipationForm, PassageForm, PoolForm, PoolTeamsForm, \
RequestValidationForm, TeamForm, TournamentForm, ValidateParticipationForm, SolutionForm, SynthesisForm
from .models import Note, Participation, Passage, Pool, Team, Tournament, Solution, Synthesis
from .tables import NoteTable, PassageTable, PoolTable, TeamTable, TournamentTable, ParticipationTable
RequestValidationForm, SolutionForm, SynthesisForm, TeamForm, TournamentForm, ValidateParticipationForm
from .models import Note, Participation, Passage, Pool, Solution, Synthesis, Team, Tournament
from .tables import NoteTable, ParticipationTable, PassageTable, PoolTable, TeamTable, TournamentTable
class CreateTeamView(LoginRequiredMixin, CreateView):
@ -434,7 +434,7 @@ class TournamentUpdateView(VolunteerMixin, UpdateView):
def dispatch(self, request, *args, **kwargs):
if not request.user.is_authenticated or not self.request.user.registration.is_admin \
and not (self.request.user.registration.is_volunteer
and self.request.user.registration.organized_tournaments.all()):
and self.request.user.registration.organized_tournaments.all()):
return self.handle_no_permission()
return super().dispatch(request, *args, **kwargs)

View File

@ -255,7 +255,7 @@ class TestRegistration(TestCase):
address="1 Rue de Rivoli, 75001 Paris, France", responsible_name="Toto",
responsible_email="toto@example.com")),
(self.coach, dict(professional_activity="God", birth_date="2001-01-01",
address="1 Rue de Rivoli, 75001 Paris, France"))]:
address="1 Rue de Rivoli, 75001 Paris, France"))]:
response = self.client.get(reverse("registration:update_user", args=(user.pk,)))
self.assertEqual(response.status_code, 200)

View File

@ -17,15 +17,14 @@ from django.utils.translation import gettext_lazy as _
from django.views.generic import CreateView, DetailView, RedirectView, TemplateView, UpdateView, View
from django_tables2 import SingleTableView
from magic import Magic
from participation.models import Solution, Synthesis, Passage
from participation.models import Passage, Solution, Synthesis
from tfjm.tokens import email_validation_token
from tfjm.views import AdminMixin, UserMixin, VolunteerMixin
from .forms import AddOrganizerForm, AdminRegistrationForm, CoachRegistrationForm, HealthSheetForm, \
ParentalAuthorizationForm, PhotoAuthorizationForm, SignupForm, StudentRegistrationForm, UserForm, \
VolunteerRegistrationForm
from .models import Registration, StudentRegistration, ParticipantRegistration
from .models import ParticipantRegistration, Registration, StudentRegistration
from .tables import RegistrationTable

View File

@ -2,7 +2,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later
from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.exceptions import PermissionDenied
from haystack.generic_views import SearchView