Skip to content

Commit a3437c0

Browse files
committed
Checks that an email address will survive encoding as part of validating a liaison form. Fixes bug 1410. Commit ready for merge.
- Legacy-Id: 7772
1 parent 393422b commit a3437c0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

ietf/liaisons/forms.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ def check_email(self, value):
153153
validate_email(addr)
154154
except ValidationError:
155155
raise forms.ValidationError('Invalid email address: %s' % addr)
156+
try:
157+
addr.encode('ascii')
158+
except UnicodeEncodeError as e:
159+
raise forms.ValidationError('Invalid email address: %s (check character %d)' % (addr,e.start))
156160

157161
def clean_response_contact(self):
158162
value = self.cleaned_data.get('response_contact', None)

0 commit comments

Comments
 (0)