Fix multiple form and table issues
This commit is contained in:
+6
-8
@@ -30,14 +30,6 @@ class MemberForm(forms.ModelForm):
|
||||
self.members = members
|
||||
self.payments = payments
|
||||
|
||||
def clean_email(self):
|
||||
email = self.cleaned_data['email']
|
||||
|
||||
if Member.objects.filter(email=email).exists():
|
||||
raise forms.ValidationError('Member with email "{}" already exists.'.format(email), code='exists')
|
||||
|
||||
return email
|
||||
|
||||
def _clean_boolean_field(self, key):
|
||||
value = self.data.get(key, None)
|
||||
if value in ['1', '0']:
|
||||
@@ -124,3 +116,9 @@ class ApplicationForm(forms.ModelForm):
|
||||
|
||||
model = Request
|
||||
fields = ['first_name', 'last_name', 'email', 'AYY', 'jas', 'POR']
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ApplicationForm, self).__init__(*args, **kwargs)
|
||||
|
||||
self.fields['AYY'].label = _("I'm a member of AYY")
|
||||
self.fields['jas'].label = _("I want to receive a weekly newsletter")
|
||||
Reference in New Issue
Block a user