Fixed ascii_validator

This commit is contained in:
Marc Aymerich 2017-03-29 20:04:42 +00:00
parent b9ba692a42
commit 7c64197468
1 changed files with 1 additions and 1 deletions

View File

@ -97,7 +97,7 @@ def validate_name(value):
def validate_ascii(value):
try:
value.encode('ascii')
except UnicodeDecodeError:
except UnicodeEncodeError:
raise ValidationError('This is not an ASCII string.')