Revision f12b3d54 flowspec/forms.py
b/flowspec/forms.py | ||
---|---|---|
145 | 145 |
if action_value: |
146 | 146 |
try: |
147 | 147 |
assert(int(action_value)) |
148 |
if int(action_value) < 50: |
|
149 |
raise forms.ValidationError('Rate-limiting cannot be < 50kbps') |
|
148 | 150 |
return "%s" %self.cleaned_data["action_value"] |
149 | 151 |
except: |
150 |
raise forms.ValidationError('Rate-limiting should be an integer') |
|
151 |
if int(action_value) < 50: |
|
152 |
raise forms.ValidationError('Rate-limiting cannot be < 50kbps') |
|
152 |
raise forms.ValidationError('Rate-limiting should be an integer < 50') |
|
153 | 153 |
else: |
154 | 154 |
raise forms.ValidationError('Cannot be empty') |
155 | 155 |
|
... | ... | |
159 | 159 |
raise forms.ValidationError('Cannot select something other than rate-limit') |
160 | 160 |
else: |
161 | 161 |
return self.cleaned_data["action"] |
162 |
|
|
162 | 163 |
|
163 | 164 |
class PortPlainForm(forms.ModelForm): |
164 | 165 |
# action = forms.CharField(initial='rate-limit') |
Also available in: Unified diff