Skip to content

Commit

Permalink
fix: edit environment
Browse files Browse the repository at this point in the history
  • Loading branch information
laurapanzariello authored and laurapanzariello committed Mar 21, 2016
1 parent 55d2d39 commit c4a327f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions CadVlan/Environment/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,8 @@ def clean(self):
v4oct5 = self.cleaned_data.get('v4oct5', '')

try:
if int(v4oct5) >= int(prefix):
self._errors['prefix'] = self.error_class(
[environment_messages.get('invalid_prefix')])
if int(v4oct5) > int(prefix):
self._errors['prefix'] = self.error_class([environment_messages.get('invalid_prefix')])
except Exception:
pass

Expand All @@ -333,8 +332,7 @@ def clean(self):

else:
if prefix not in range(129):
self._errors['prefix'] = self.error_class(
[environment_messages.get('invalid_prefix_ipv6')])
self._errors['prefix'] = self.error_class([environment_messages.get('invalid_prefix_ipv6')])

v6oct1 = self.cleaned_data.get('v6oct1', '')
v6oct2 = self.cleaned_data.get('v6oct2', '')
Expand All @@ -347,9 +345,8 @@ def clean(self):
v6oct9 = self.cleaned_data.get('v6oct9', '')

try:
if int(v6oct9) >= int(prefix):
self._errors['prefix'] = self.error_class(
[environment_messages.get('invalid_prefix')])
if int(v6oct9) > int(prefix):
self._errors['prefix'] = self.error_class([environment_messages.get('invalid_prefix')])
except Exception:
pass

Expand Down

0 comments on commit c4a327f

Please sign in to comment.