Skip to content

Commit de46f5c

Browse files
committed
fields: replace IPy dependency with ipaddress module
Resolves #229
1 parent 227562a commit de46f5c

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

mirrors/fields.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
from IPy import IP
2-
31
from django import forms
42
from django.core import validators
53
from django.core.exceptions import ValidationError
64
from django.db import models
75

6+
from ipaddress import ip_address as IP
87

98
class IPNetworkFormField(forms.Field):
109
def to_python(self, value):

mirrors/tests/test_mirrorrsync.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ def test_ipv4(self):
2727
def test_invalid(self):
2828
with self.assertRaises(ValueError) as e:
2929
MirrorRsync.objects.create(ip="8.8.8.8.8", mirror=self.mirror)
30-
self.assertIn('IPv4 Address with more than 4 bytes', str(e.exception))
30+
self.assertIn('does not appear to be an IPv4 or IPv6 address', str(e.exception))

requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
-e git+git://github.com/fredj/cssmin.git@master#egg=cssmin
22
Django==3.0.7
3-
IPy==1.00
43
Markdown==3.2.1
54
bencode.py==2.0.0
65
django-countries==5.5

0 commit comments

Comments
 (0)