diff options
author | Dan McGee <dan@archlinux.org> | 2011-10-11 19:29:15 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-10-11 19:29:15 -0500 |
commit | 71e57570c262fffb11ca6e0dc97342119198f740 (patch) | |
tree | 3736af12cda316baffbcc4e5ba2a43f41901b847 /mirrors | |
parent | a01a11cfad84bd44c1f5aeffcc0665bd93889e1d (diff) |
Pylint suggested and other cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors')
-rw-r--r-- | mirrors/admin.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mirrors/admin.py b/mirrors/admin.py index 0632872d..3786d8d2 100644 --- a/mirrors/admin.py +++ b/mirrors/admin.py @@ -33,14 +33,15 @@ 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}$') +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) + super(IPAddressNetmaskField, self).__init__(IPV4NM_RE, *args, **kwargs) class MirrorRsyncForm(forms.ModelForm): class Meta: |