diff --git a/django/forms/fields.py b/django/forms/fields.py
index 4438812..7e41d6e 100644
a
|
b
|
class URLField(CharField):
|
600 | 600 | |
601 | 601 | value = super(URLField, self).to_python(value) |
602 | 602 | if value: |
603 | | url_fields = split_url(value) |
| 603 | url_fields = split_url(value.strip()) |
604 | 604 | if not url_fields[0]: |
605 | 605 | # If no URL scheme given, assume http:// |
606 | 606 | url_fields[0] = 'http' |
… |
… |
class IPAddressField(CharField):
|
988 | 988 | } |
989 | 989 | default_validators = [validators.validate_ipv4_address] |
990 | 990 | |
| 991 | def to_python(self, value): |
| 992 | return value.strip() |
991 | 993 | |
992 | 994 | class GenericIPAddressField(CharField): |
993 | 995 | default_error_messages = {} |
… |
… |
class GenericIPAddressField(CharField):
|
1003 | 1005 | if value in validators.EMPTY_VALUES: |
1004 | 1006 | return '' |
1005 | 1007 | if value and ':' in value: |
1006 | | return clean_ipv6_address(value, |
| 1008 | return clean_ipv6_address(value.strip(), |
1007 | 1009 | self.unpack_ipv4, self.error_messages['invalid']) |
1008 | 1010 | return value |
1009 | 1011 | |
… |
… |
class SlugField(CharField):
|
1014 | 1016 | " underscores or hyphens."), |
1015 | 1017 | } |
1016 | 1018 | default_validators = [validators.validate_slug] |
| 1019 | |
| 1020 | def to_python(self, value): |
| 1021 | return value.strip() |