1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 06:22:22 +00:00
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-02-23 23:05:10 +01:00
parent 2c54f315f6
commit 7b4e867e33
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
8 changed files with 13 additions and 15 deletions

View File

@ -6,8 +6,8 @@ from django.contrib.admin import ModelAdmin
from django.contrib.auth.admin import UserAdmin from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from polymorphic.admin import PolymorphicChildModelAdmin, PolymorphicChildModelFilter, PolymorphicParentModelAdmin, \ from polymorphic.admin import PolymorphicChildModelAdmin, PolymorphicChildModelFilter, PolymorphicInlineSupportMixin, \
PolymorphicInlineSupportMixin, StackedPolymorphicInline PolymorphicParentModelAdmin, StackedPolymorphicInline
from .models import CoachRegistration, ParticipantRegistration, Payment, Registration, \ from .models import CoachRegistration, ParticipantRegistration, Payment, Registration, \
StudentRegistration, VolunteerRegistration StudentRegistration, VolunteerRegistration

View File

@ -281,4 +281,3 @@ class PaymentForm(forms.ModelForm):
class Meta: class Meta:
model = Payment model = Payment
fields = ('type', 'receipt', 'additional_information',) fields = ('type', 'receipt', 'additional_information',)

View File

@ -5,7 +5,7 @@ import json
from django.core.management import BaseCommand from django.core.management import BaseCommand
from registration.models import Payment from ...models import Payment
class Command(BaseCommand): class Command(BaseCommand):

View File

@ -3,7 +3,7 @@
from django.core.management import BaseCommand from django.core.management import BaseCommand
from registration.models import Payment from ...models import Payment
class Command(BaseCommand): class Command(BaseCommand):

View File

@ -8,7 +8,7 @@ from django.core.mail import send_mail
from django.core.validators import MaxValueValidator, MinValueValidator from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models from django.db import models
from django.template import loader 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 import timezone, translation
from django.utils.crypto import get_random_string from django.utils.crypto import get_random_string
from django.utils.encoding import force_bytes 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 django.utils.translation import gettext_lazy as _
from phonenumber_field.modelfields import PhoneNumberField from phonenumber_field.modelfields import PhoneNumberField
from polymorphic.models import PolymorphicModel from polymorphic.models import PolymorphicModel
from tfjm import helloasso from tfjm import helloasso
from tfjm.tokens import email_validation_token from tfjm.tokens import email_validation_token

View File

@ -3,8 +3,8 @@
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
import django_tables2 as tables import django_tables2 as tables
from participation.models import Team from participation.models import Team
from .models import Payment, Registration from .models import Payment, Registration

View File

@ -5,7 +5,7 @@ from django.urls import path
from .views import AddOrganizerView, AdultPhotoAuthorizationTemplateView, ChildPhotoAuthorizationTemplateView, \ from .views import AddOrganizerView, AdultPhotoAuthorizationTemplateView, ChildPhotoAuthorizationTemplateView, \
InstructionsTemplateView, MyAccountDetailView, ParentalAuthorizationTemplateView, \ InstructionsTemplateView, MyAccountDetailView, ParentalAuthorizationTemplateView, \
PaymentHelloAssoReturnView, PaymentUpdateGroupView, PaymentUpdateView, PaymenRedirectHelloAssoView, \ PaymentHelloAssoReturnView, PaymentRedirectHelloAssoView, PaymentUpdateGroupView, PaymentUpdateView, \
ResetAdminView, SignupView, UserDetailView, UserImpersonateView, UserListView, UserResendValidationEmailView, \ ResetAdminView, SignupView, UserDetailView, UserImpersonateView, UserListView, UserResendValidationEmailView, \
UserUpdateView, UserUploadHealthSheetView, UserUploadParentalAuthorizationView, UserUploadPhotoAuthorizationView, \ UserUpdateView, UserUploadHealthSheetView, UserUploadParentalAuthorizationView, UserUploadPhotoAuthorizationView, \
UserUploadVaccineSheetView, UserValidateView, UserValidationEmailSentView UserUploadVaccineSheetView, UserValidateView, UserValidationEmailSentView
@ -40,7 +40,7 @@ urlpatterns = [
path("update-payment/<int:pk>/", PaymentUpdateView.as_view(), name="update_payment"), path("update-payment/<int:pk>/", PaymentUpdateView.as_view(), name="update_payment"),
path("update-payment/<int:pk>/toggle-group-mode/", PaymentUpdateGroupView.as_view(), path("update-payment/<int:pk>/toggle-group-mode/", PaymentUpdateGroupView.as_view(),
name="update_payment_group_mode"), name="update_payment_group_mode"),
path("update-payment/<int:pk>/hello-asso/", PaymenRedirectHelloAssoView.as_view(), name="payment_hello_asso"), path("update-payment/<int:pk>/hello-asso/", PaymentRedirectHelloAssoView.as_view(), name="payment_hello_asso"),
path("update-payment/<int:pk>/hello-asso/return/", PaymentHelloAssoReturnView.as_view(), path("update-payment/<int:pk>/hello-asso/return/", PaymentHelloAssoReturnView.as_view(),
name="payment_hello_asso_return"), name="payment_hello_asso_return"),
path("user/<int:pk>/impersonate/", UserImpersonateView.as_view(), name="user_impersonate"), path("user/<int:pk>/impersonate/", UserImpersonateView.as_view(), name="user_impersonate"),

View File

@ -29,9 +29,9 @@ from participation.models import Passage, Solution, Synthesis, Tournament
from tfjm.tokens import email_validation_token from tfjm.tokens import email_validation_token
from tfjm.views import UserMixin, UserRegistrationMixin, VolunteerMixin from tfjm.views import UserMixin, UserRegistrationMixin, VolunteerMixin
from .forms import AddOrganizerForm, CoachRegistrationForm, HealthSheetForm, \ from .forms import AddOrganizerForm, CoachRegistrationForm, HealthSheetForm, ParentalAuthorizationForm, \
ParentalAuthorizationForm, PaymentForm, PhotoAuthorizationForm, SignupForm, StudentRegistrationForm, UserForm, \ PaymentAdminForm, PaymentForm, PhotoAuthorizationForm, SignupForm, StudentRegistrationForm, UserForm, \
VaccineSheetForm, VolunteerRegistrationForm, PaymentAdminForm VaccineSheetForm, VolunteerRegistrationForm
from .models import ParticipantRegistration, Payment, Registration, StudentRegistration from .models import ParticipantRegistration, Payment, Registration, StudentRegistration
from .tables import RegistrationTable from .tables import RegistrationTable
@ -535,7 +535,7 @@ class PaymentUpdateGroupView(LoginRequiredMixin, DetailView):
return redirect(reverse_lazy("registration:update_payment", args=(payment.pk,))) return redirect(reverse_lazy("registration:update_payment", args=(payment.pk,)))
class PaymenRedirectHelloAssoView(AccessMixin, DetailView): class PaymentRedirectHelloAssoView(AccessMixin, DetailView):
model = Payment model = Payment
def dispatch(self, request, *args, **kwargs): def dispatch(self, request, *args, **kwargs):
@ -781,7 +781,7 @@ class SolutionView(LoginRequiredMixin, View):
if not (user.registration.is_admin if not (user.registration.is_admin
or user.registration.is_volunteer and user.registration or user.registration.is_volunteer and user.registration
in (solution.participation.tournament 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 or user.registration.is_volunteer
and Passage.objects.filter(Q(pool__juries=user.registration) and Passage.objects.filter(Q(pool__juries=user.registration)
| Q(pool__tournament__in=user.registration.organized_tournaments.all()), | Q(pool__tournament__in=user.registration.organized_tournaments.all()),