Django Sitemap Framework integriert

This commit is contained in:
2016-10-11 23:54:18 +02:00
parent 8595959872
commit ba44e97e9a
20 changed files with 249 additions and 176 deletions

View File

@@ -16,7 +16,11 @@ from utils.massmailer import MassMailer
class MembershipForm(forms.ModelForm):
error_css_class = 'error'
required_css_class = 'required'
birthday = forms.DateField(label=_('birthday'), required=False)
birthday = forms.DateField(
label=_('birthday'),
required=False,
help_text=_('Input format: yyyy-mm-dd')
)
email = forms.EmailField(label=_('Email'), required=True)
class Meta:
@@ -33,13 +37,6 @@ class MembershipForm(forms.ModelForm):
Please fill out this field yet.'))
return self.cleaned_data['birthday']
def clean_telephone(self):
if self.cleaned_data['membership'] and not self.cleaned_data[
'telephone']:
raise forms.ValidationError(_('For your membership, we need this. \
Please fill out this field yet.'))
return self.cleaned_data['telephone']
def clean_street_name(self):
if self.cleaned_data['membership'] and not self.cleaned_data[
'street_name']:
@@ -68,10 +65,8 @@ class RegistrationForm(MembershipForm):
requires the password to be entered twice to catch typos.
sends an activation request per mail, to validate the eMail.
"""
password1 = forms.CharField(widget=forms.PasswordInput(),
label=_('password'))
password2 = forms.CharField(widget=forms.PasswordInput(),
label=_('password (again)'))
password1 = forms.CharField(widget=forms.PasswordInput(), label=_('password'))
password2 = forms.CharField(widget=forms.PasswordInput(), label=_('password (again)'))
recaptcha = forms.ReCaptchaField()
class Meta: