Esempio n. 1
0
    def clean_email_address(self):
        """
        Use our utility methods to sanitize and validate the submitted email address.
        """
        email = _sanitize_email(self.cleaned_data['email_address'])
        if not _email_is_valid(email):
            raise forms.ValidationError(_('The email address you submitted was not valid.'))

        return email
Esempio n. 2
0
 def clean_email_address(self):
     """
     use our utility methods to sanitize & verify email address
     """
     email = _sanitize_email(self.cleaned_data['email_address'])
     if not _email_is_valid(email):
         raise forms.ValidationError("The email address you submitted was not valid."
                                     "Please try again with a different address.")
     return email
Esempio n. 3
0
    def clean_email_address(self):
        """
        Use our utility methods to sanitize and validate the submitted email address.
        """
        email = _sanitize_email(self.cleaned_data['email_address'])
        if not _email_is_valid(email):
            raise forms.ValidationError(
                _('The email address you submitted was not valid.'))

        return email
Esempio n. 4
0
 def clean_email_address(self):
     """
     use our utility methods to sanitize & verify email address
     """
     email = _sanitize_email(self.cleaned_data['email_address'])
     if not _email_is_valid(email):
         raise forms.ValidationError(
             "The email address you submitted was not valid."
             "Please try again with a different address.")
     return email
Esempio n. 5
0
    def clean_email_address(self):
        """
        Use our utility methods to sanitize and validate the submitted email address.
        """
        email = _sanitize_email(self.cleaned_data['email_address'])
        if not _email_is_valid(email):
            raise forms.ValidationError(_('The email address you submitted was not valid.'))

        try:
            self.email_address = EmailAddress.objects.get(email=email)
            if self.email_address.subscriptions.count() < 1:
                raise forms.ValidationError(_('This email has no active subscriptions.'))
        except EmailAddress.DoesNotExist:
            raise forms.ValidationError(_('The email address you submitted does not exist in our system.'))

        return email
Esempio n. 6
0
    def clean_email_address(self):
        """
        Use our utility methods to sanitize and validate the submitted email address.
        """
        email = _sanitize_email(self.cleaned_data['email_address'])
        if not _email_is_valid(email):
            raise forms.ValidationError(
                _('The email address you submitted was not valid.'))

        try:
            self.email_address = EmailAddress.objects.get(email=email)
            if self.email_address.subscriptions.count() < 1:
                raise forms.ValidationError(
                    _('This email has no active subscriptions.'))
        except EmailAddress.DoesNotExist:
            raise forms.ValidationError(
                _('The email address you submitted does not exist in our system.'
                  ))

        return email