def clean_email(self):
email = self.cleaned_data['email'].strip()
if User.objects.filter(email__iexact=email).exists():
raise ValidationError('...')
return email
CREATE UNIQUE INDEX accounts_email_uniq ON accounts_user USING BTREE ((lower((email)::text)));