offercoaching form works
This commit is contained in:
@@ -3201,23 +3201,6 @@ class AccountRowerForm(ModelForm):
|
||||
if self.instance.rowerplan != 'coach':
|
||||
self.fields.pop('offercoaching')
|
||||
|
||||
def clean_email(self):
|
||||
email = self.cleaned_data.get('email')
|
||||
|
||||
try:
|
||||
validate_email(email)
|
||||
except ValidationError:
|
||||
raise forms.ValidationError(
|
||||
'Please enter a valid email address')
|
||||
|
||||
try:
|
||||
match = User.objects.get(email__iexact=email)
|
||||
if self.instance.user == match:
|
||||
return email
|
||||
except User.DoesNotExist:
|
||||
return email
|
||||
|
||||
raise forms.ValidationError('This email address is not allowed')
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user