def validate_phone2(self, attrs, source): try: value = clean_international_phonenumber(attrs[source]) except KeyError: pass else: # Store formatted phone number attrs[source] = value return attrs
def validate_alerting_phone(self, attrs, source): try: value = attrs[source] except KeyError: pass else: if value: # Store formatted phone number attrs[source] = clean_international_phonenumber(value) return attrs
def validate_phone(self, attrs, source): try: value = clean_international_phonenumber(attrs[source]) except KeyError: pass else: if self.object.phone == value: return attrs else: # Store old phone number for later so we know we have to send text message self.old_phone = self.object.phone # Store formatted phone number attrs[source] = value return attrs
def clean_phone(self): return clean_international_phonenumber(self.cleaned_data['phone'])