if action_value:
try:
assert(int(action_value))
+ if int(action_value) < 50:
+ raise forms.ValidationError('Rate-limiting cannot be < 50kbps')
return "%s" %self.cleaned_data["action_value"]
except:
- raise forms.ValidationError('Rate-limiting should be an integer')
- if int(action_value) < 50:
- raise forms.ValidationError('Rate-limiting cannot be < 50kbps')
+ raise forms.ValidationError('Rate-limiting should be an integer < 50')
else:
raise forms.ValidationError('Cannot be empty')
raise forms.ValidationError('Cannot select something other than rate-limit')
else:
return self.cleaned_data["action"]
+
class PortPlainForm(forms.ModelForm):
# action = forms.CharField(initial='rate-limit')
return ret.rstrip(":")
class Meta:
db_table = u'then_action'
+ unique_together = ("action", "action_value")
class Route(models.Model):
name = models.SlugField(max_length=128)
}
.accord_wrapper{
- height: 100% !important;
+ height: 452px !important;
}
.help {
</table>
<div id='portsacc' style="width: 500px;">
<h3 style="padding: 0.5em 0.5em 0.5em 0.7em;">Advanced Settings (Ports)</h3>
- <div class='accord_wrapper' style="height: 100% !important;">
+ <div class='accord_wrapper' style="height: 452px !important;">
Select source/destination port(s), or select common port(s) for both source/destination
<table>
<tr>