Unicode fix reverted but can have custom validator
MongoEngine/mongoengine#136
This commit is contained in:
parent
6f0a6df4f6
commit
e6d796832e
4 changed files with 5 additions and 10 deletions
|
|
@ -118,11 +118,8 @@ class URLField(StringField):
|
|||
|
||||
def validate(self, value):
|
||||
if not self.url_regex.match(value):
|
||||
scheme, netloc, path, query, fragment = urlparse.urlsplit(value)
|
||||
try:
|
||||
netloc = netloc.encode('idna') # IDN -> ACE
|
||||
except UnicodeError: # invalid domain part
|
||||
self.error('Invalid URL: %s' % value)
|
||||
self.error('Invalid URL: %s' % value)
|
||||
return
|
||||
|
||||
if self.verify_exists:
|
||||
warnings.warn(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue