diff --git a/registration/admin.py b/registration/admin.py index d43c792..d42b9bc 100644 --- a/registration/admin.py +++ b/registration/admin.py @@ -6,8 +6,8 @@ from django.contrib.admin import ModelAdmin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.utils.translation import gettext_lazy as _ -from polymorphic.admin import PolymorphicChildModelAdmin, PolymorphicChildModelFilter, PolymorphicParentModelAdmin, \ - PolymorphicInlineSupportMixin, StackedPolymorphicInline +from polymorphic.admin import PolymorphicChildModelAdmin, PolymorphicChildModelFilter, PolymorphicInlineSupportMixin, \ + PolymorphicParentModelAdmin, StackedPolymorphicInline from .models import CoachRegistration, ParticipantRegistration, Payment, Registration, \ StudentRegistration, VolunteerRegistration diff --git a/registration/forms.py b/registration/forms.py index a25d573..02bb946 100644 --- a/registration/forms.py +++ b/registration/forms.py @@ -281,4 +281,3 @@ class PaymentForm(forms.ModelForm): class Meta: model = Payment fields = ('type', 'receipt', 'additional_information',) - diff --git a/registration/management/commands/check_hello_asso.py b/registration/management/commands/check_hello_asso.py index 90b3e89..10fa767 100644 --- a/registration/management/commands/check_hello_asso.py +++ b/registration/management/commands/check_hello_asso.py @@ -5,7 +5,7 @@ import json from django.core.management import BaseCommand -from registration.models import Payment +from ...models import Payment class Command(BaseCommand): diff --git a/registration/management/commands/remind_payments.py b/registration/management/commands/remind_payments.py index ec85a9c..a1ded6f 100644 --- a/registration/management/commands/remind_payments.py +++ b/registration/management/commands/remind_payments.py @@ -3,7 +3,7 @@ from django.core.management import BaseCommand -from registration.models import Payment +from ...models import Payment class Command(BaseCommand): diff --git a/registration/models.py b/registration/models.py index bf18892..3dad4a6 100644 --- a/registration/models.py +++ b/registration/models.py @@ -8,7 +8,7 @@ from django.core.mail import send_mail from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from django.template import loader -from django.urls import reverse_lazy, reverse +from django.urls import reverse, reverse_lazy from django.utils import timezone, translation from django.utils.crypto import get_random_string from django.utils.encoding import force_bytes @@ -17,7 +17,6 @@ from django.utils.text import format_lazy from django.utils.translation import gettext_lazy as _ from phonenumber_field.modelfields import PhoneNumberField from polymorphic.models import PolymorphicModel - from tfjm import helloasso from tfjm.tokens import email_validation_token diff --git a/registration/tables.py b/registration/tables.py index 0c97513..e7b5c92 100644 --- a/registration/tables.py +++ b/registration/tables.py @@ -3,8 +3,8 @@ from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ import django_tables2 as tables - from participation.models import Team + from .models import Payment, Registration diff --git a/registration/urls.py b/registration/urls.py index 5de4de3..38c0872 100644 --- a/registration/urls.py +++ b/registration/urls.py @@ -5,7 +5,7 @@ from django.urls import path from .views import AddOrganizerView, AdultPhotoAuthorizationTemplateView, ChildPhotoAuthorizationTemplateView, \ InstructionsTemplateView, MyAccountDetailView, ParentalAuthorizationTemplateView, \ - PaymentHelloAssoReturnView, PaymentUpdateGroupView, PaymentUpdateView, PaymenRedirectHelloAssoView, \ + PaymentHelloAssoReturnView, PaymentRedirectHelloAssoView, PaymentUpdateGroupView, PaymentUpdateView, \ ResetAdminView, SignupView, UserDetailView, UserImpersonateView, UserListView, UserResendValidationEmailView, \ UserUpdateView, UserUploadHealthSheetView, UserUploadParentalAuthorizationView, UserUploadPhotoAuthorizationView, \ UserUploadVaccineSheetView, UserValidateView, UserValidationEmailSentView @@ -40,7 +40,7 @@ urlpatterns = [ path("update-payment//", PaymentUpdateView.as_view(), name="update_payment"), path("update-payment//toggle-group-mode/", PaymentUpdateGroupView.as_view(), name="update_payment_group_mode"), - path("update-payment//hello-asso/", PaymenRedirectHelloAssoView.as_view(), name="payment_hello_asso"), + path("update-payment//hello-asso/", PaymentRedirectHelloAssoView.as_view(), name="payment_hello_asso"), path("update-payment//hello-asso/return/", PaymentHelloAssoReturnView.as_view(), name="payment_hello_asso_return"), path("user//impersonate/", UserImpersonateView.as_view(), name="user_impersonate"), diff --git a/registration/views.py b/registration/views.py index 5972ff3..490a187 100644 --- a/registration/views.py +++ b/registration/views.py @@ -29,9 +29,9 @@ from participation.models import Passage, Solution, Synthesis, Tournament from tfjm.tokens import email_validation_token from tfjm.views import UserMixin, UserRegistrationMixin, VolunteerMixin -from .forms import AddOrganizerForm, CoachRegistrationForm, HealthSheetForm, \ - ParentalAuthorizationForm, PaymentForm, PhotoAuthorizationForm, SignupForm, StudentRegistrationForm, UserForm, \ - VaccineSheetForm, VolunteerRegistrationForm, PaymentAdminForm +from .forms import AddOrganizerForm, CoachRegistrationForm, HealthSheetForm, ParentalAuthorizationForm, \ + PaymentAdminForm, PaymentForm, PhotoAuthorizationForm, SignupForm, StudentRegistrationForm, UserForm, \ + VaccineSheetForm, VolunteerRegistrationForm from .models import ParticipantRegistration, Payment, Registration, StudentRegistration from .tables import RegistrationTable @@ -535,7 +535,7 @@ class PaymentUpdateGroupView(LoginRequiredMixin, DetailView): return redirect(reverse_lazy("registration:update_payment", args=(payment.pk,))) -class PaymenRedirectHelloAssoView(AccessMixin, DetailView): +class PaymentRedirectHelloAssoView(AccessMixin, DetailView): model = Payment def dispatch(self, request, *args, **kwargs): @@ -781,7 +781,7 @@ class SolutionView(LoginRequiredMixin, View): if not (user.registration.is_admin or user.registration.is_volunteer and user.registration in (solution.participation.tournament - if not solution.final_solution else Tournament.final_tournament()).organizers.all() + if not solution.final_solution else Tournament.final_tournament()).organizers.all() or user.registration.is_volunteer and Passage.objects.filter(Q(pool__juries=user.registration) | Q(pool__tournament__in=user.registration.organized_tournaments.all()),