Esempio n. 1
0
 def clean_email_or_fax(self):
     """Validate the email_or_fax field"""
     return get_email_or_fax(self.cleaned_data['email_or_fax'])
Esempio n. 2
0
 def clean_email_or_fax(self):
     """Validate the email_or_fax field"""
     if self.cleaned_data["email_or_fax"]:
         return get_email_or_fax(self.cleaned_data["email_or_fax"])
     else:
         return None
Esempio n. 3
0
 def create(self, text):
     """Create the email or fax from the given text"""
     try:
         return str(get_email_or_fax(text))
     except ValidationError:
         return None