mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 00:52:03 +01:00 
			
		
		
		
	Allow to remove the checkbox to be recontacted by Animath
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
		@@ -2,6 +2,7 @@
 | 
			
		||||
# SPDX-License-Identifier: GPL-3.0-or-later
 | 
			
		||||
 | 
			
		||||
from django import forms
 | 
			
		||||
from django.conf import settings
 | 
			
		||||
from django.contrib.auth.forms import UserCreationForm
 | 
			
		||||
from django.contrib.auth.models import User
 | 
			
		||||
from django.core.exceptions import ValidationError
 | 
			
		||||
@@ -103,6 +104,8 @@ class StudentRegistrationForm(forms.ModelForm):
 | 
			
		||||
    def __init__(self, *args, **kwargs):
 | 
			
		||||
        super().__init__(*args, **kwargs)
 | 
			
		||||
        self.fields["birth_date"].widget = forms.DateInput(attrs={'type': 'date'}, format='%Y-%m-%d')
 | 
			
		||||
        if not settings.SUGGEST_ANIMATH:
 | 
			
		||||
            del self.fields["give_contact_to_animath"]
 | 
			
		||||
 | 
			
		||||
    class Meta:
 | 
			
		||||
        model = StudentRegistration
 | 
			
		||||
@@ -248,6 +251,11 @@ class CoachRegistrationForm(forms.ModelForm):
 | 
			
		||||
    """
 | 
			
		||||
    A coach can tell its professional activity.
 | 
			
		||||
    """
 | 
			
		||||
    def __init__(self, *args, **kwargs):
 | 
			
		||||
        super().__init__(*args, **kwargs)
 | 
			
		||||
        if not settings.SUGGEST_ANIMATH:
 | 
			
		||||
            del self.fields["give_contact_to_animath"]
 | 
			
		||||
 | 
			
		||||
    class Meta:
 | 
			
		||||
        model = CoachRegistration
 | 
			
		||||
        fields = ('team', 'gender', 'address', 'zip_code', 'city', 'country', 'phone_number',
 | 
			
		||||
@@ -259,6 +267,11 @@ class VolunteerRegistrationForm(forms.ModelForm):
 | 
			
		||||
    """
 | 
			
		||||
    A volunteer can also tell its professional activity.
 | 
			
		||||
    """
 | 
			
		||||
    def __init__(self, *args, **kwargs):
 | 
			
		||||
        super().__init__(*args, **kwargs)
 | 
			
		||||
        if not settings.SUGGEST_ANIMATH:
 | 
			
		||||
            del self.fields["give_contact_to_animath"]
 | 
			
		||||
 | 
			
		||||
    class Meta:
 | 
			
		||||
        model = VolunteerRegistration
 | 
			
		||||
        fields = ('professional_activity', 'admin', 'give_contact_to_animath', 'email_confirmed',)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user