Ticket #2997: URLField.diff
File URLField.diff, 767 bytes (added by , 18 years ago) |
---|
-
django/newforms/fields.py
215 215 "User-Agent": self.user_agent, 216 216 } 217 217 try: 218 req = urllib2.Request( field_data, None, headers)218 req = urllib2.Request(value, None, headers) 219 219 u = urllib2.urlopen(req) 220 220 except ValueError: 221 221 raise ValidationError(u'Enter a valid URL.') 222 except : # urllib2.URLError, httplib.InvalidURL, etc.222 except urllib2.URLError: 223 223 raise ValidationError(u'This URL appears to be a broken link.') 224 224 return value 225 225