Fixed #7345 -- In [8089], I'd forgotten that urlparse.urlsplit() didn't return
something with attributes until Python 2.5. Thanks, Honza Kral and apollo13. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8093 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
8099bc536b
commit
03373f1e24
|
@ -541,7 +541,7 @@ class URLField(RegexField):
|
||||||
if value and '://' not in value:
|
if value and '://' not in value:
|
||||||
value = u'http://%s' % value
|
value = u'http://%s' % value
|
||||||
# If no URL path given, assume /
|
# If no URL path given, assume /
|
||||||
if value and not urlparse.urlsplit(value).path:
|
if value and not urlparse.urlsplit(value)[2]:
|
||||||
value += '/'
|
value += '/'
|
||||||
value = super(URLField, self).clean(value)
|
value = super(URLField, self).clean(value)
|
||||||
if value == u'':
|
if value == u'':
|
||||||
|
|
Loading…
Reference in New Issue