summaryrefslogtreecommitdiff
path: root/mirrors/admin.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-04-10 21:00:17 -0500
committerDan McGee <dan@archlinux.org>2013-04-10 21:03:09 -0500
commit06e1e857abfdf7f95661d337ce3c315bd51fb837 (patch)
tree7d14e91e1b2f953c6ecfccaca4f315837f4e68a3 /mirrors/admin.py
parent90e969a160e1ec028ded1ca9b33975ec50fed154 (diff)
Allow mirror rsync IPs to be IPv4/IPv6 addresses or networksrelease_2013-04-10
This gives us a bunch more flexibility on this field, and now supports all the options that the rsync config file supports. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors/admin.py')
-rw-r--r--mirrors/admin.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/mirrors/admin.py b/mirrors/admin.py
index d6ea3950..9c88207d 100644
--- a/mirrors/admin.py
+++ b/mirrors/admin.py
@@ -1,4 +1,3 @@
-import re
from urlparse import urlparse, urlunsplit
from django import forms
@@ -36,22 +35,9 @@ class MirrorUrlInlineAdmin(admin.TabularInline):
extra = 3
-# ripped off from django.forms.fields, adding netmask ability
-IPV4NM_RE = re.compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}(/(\d|[1-2]\d|3[0-2])){0,1}$')
-
-class IPAddressNetmaskField(forms.fields.RegexField):
- default_error_messages = {
- 'invalid': u'Enter a valid IPv4 address, possibly including netmask.',
- }
-
- def __init__(self, *args, **kwargs):
- super(IPAddressNetmaskField, self).__init__(IPV4NM_RE, *args, **kwargs)
-
-
class MirrorRsyncForm(forms.ModelForm):
class Meta:
model = MirrorRsync
- ip = IPAddressNetmaskField(label='IP')
class MirrorRsyncInlineAdmin(admin.TabularInline):