Code

Ticket #20740: backport-1.6.x.diff

File backport-1.6.x.diff, 660 bytes (added by Jeff250, 9 months ago)

Additional patch required for 1.6.x backport

Line 
1diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
2index 2212346..0b5e7d4 100644
3--- a/django/db/models/fields/__init__.py
4+++ b/django/db/models/fields/__init__.py
5@@ -1131,6 +1131,7 @@ class GenericIPAddressField(Field):
6     def __init__(self, verbose_name=None, name=None, protocol='both',
7                  unpack_ipv4=False, *args, **kwargs):
8         self.unpack_ipv4 = unpack_ipv4
9+        self.protocol = protocol
10         self.default_validators, invalid_error_message = \
11             validators.ip_address_validators(protocol, unpack_ipv4)
12         self.default_error_messages['invalid'] = invalid_error_message