Commit cc8e8ba6 by Brian Wilson

Pearson reg: relax validation of phone country codes.

parent 21fe5827
...@@ -287,13 +287,7 @@ class TestCenterUserForm(ModelForm): ...@@ -287,13 +287,7 @@ class TestCenterUserForm(ModelForm):
def clean_country(self): def clean_country(self):
return self.check_country_code('country') return self.check_country_code('country')
def clean_phone_country_code(self):
return self.check_country_code('phone_country_code')
def clean_fax_country_code(self):
return self.check_country_code('fax_country_code')
def clean(self): def clean(self):
cleaned_data = super(TestCenterUserForm, self).clean() cleaned_data = super(TestCenterUserForm, self).clean()
...@@ -317,7 +311,7 @@ class TestCenterUserForm(ModelForm): ...@@ -317,7 +311,7 @@ class TestCenterUserForm(ModelForm):
cleaned_data_fields = [fieldname for fieldname in cleaned_data] cleaned_data_fields = [fieldname for fieldname in cleaned_data]
for fieldname in cleaned_data_fields: for fieldname in cleaned_data_fields:
if not TestCenterUserForm.can_encode_as_latin(cleaned_data[fieldname]): if not TestCenterUserForm.can_encode_as_latin(cleaned_data[fieldname]):
self._errors[fieldname] = self.error_class([u'Must only use characters in Latin-1 encoding']) self._errors[fieldname] = self.error_class([u'Must only use characters in Latin-1 (iso-8859-1) encoding'])
del cleaned_data[fieldname] del cleaned_data[fieldname]
# Always return the full collection of cleaned data. # Always return the full collection of cleaned data.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment