Paginator der besser ins Design passt.
This commit is contained in:
@@ -3,11 +3,12 @@ Created on 03.10.2011
|
||||
|
||||
@author: Christian
|
||||
"""
|
||||
from . import models
|
||||
from django.conf import settings
|
||||
from django.contrib import auth
|
||||
from django.contrib.sites.models import Site
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from . import models
|
||||
from utils.html5 import forms
|
||||
from utils.massmailer import MassMailer
|
||||
|
||||
@@ -26,25 +27,29 @@ class MembershipForm(forms.ModelForm):
|
||||
)
|
||||
|
||||
def clean_birthday(self):
|
||||
if self.cleaned_data['membership'] and not self.cleaned_data['birthday']:
|
||||
if self.cleaned_data['membership'] and not self.cleaned_data[
|
||||
'birthday']:
|
||||
raise forms.ValidationError(_('For your membership, we need this. \
|
||||
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']:
|
||||
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']:
|
||||
if self.cleaned_data['membership'] and not self.cleaned_data[
|
||||
'street_name']:
|
||||
raise forms.ValidationError(_('For your membership, we need this. \
|
||||
Please fill out this field yet.'))
|
||||
return self.cleaned_data['street_name']
|
||||
|
||||
def clean_post_code(self):
|
||||
if self.cleaned_data['membership'] and not self.cleaned_data['post_code']:
|
||||
if self.cleaned_data['membership'] and not self.cleaned_data[
|
||||
'post_code']:
|
||||
raise forms.ValidationError(_('For your membership, we need this. \
|
||||
Please fill out this field yet.'))
|
||||
return self.cleaned_data['post_code']
|
||||
@@ -103,7 +108,8 @@ class RegistrationForm(forms.ModelForm):
|
||||
"""
|
||||
Validate that the supplied email address is unique for the site.
|
||||
"""
|
||||
if auth.get_user_model().objects.filter(email__iexact=self.cleaned_data['email']):
|
||||
if auth.get_user_model().objects.filter(
|
||||
email__iexact=self.cleaned_data['email']):
|
||||
raise forms.ValidationError(_(u'This email address is already in \
|
||||
use. Please supply a different email address.'))
|
||||
return self.cleaned_data['email']
|
||||
@@ -139,6 +145,7 @@ class RegistrationForm(forms.ModelForm):
|
||||
user.is_active = False
|
||||
if commit:
|
||||
user.save()
|
||||
activation = models.ActivationRequest.objects.create_pending_registration(user)
|
||||
activation = models.ActivationRequest.objects.create_pending_registration(
|
||||
user)
|
||||
self.send_email(activation)
|
||||
return user
|
||||
|
||||
Reference in New Issue
Block a user