Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
flowspy
Commits
f12b3d54
Commit
f12b3d54
authored
Dec 21, 2011
by
Leonidas Poulopoulos
Browse files
Fixed a bug where rate limiting values were not checked against the lowest value. Closes #1804
parent
6d48c46c
Changes
3
Hide whitespace changes
Inline
Side-by-side
flowspec/forms.py
View file @
f12b3d54
...
...
@@ -145,11 +145,11 @@ class ThenPlainForm(forms.ModelForm):
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'
)
...
...
@@ -159,6 +159,7 @@ class ThenPlainForm(forms.ModelForm):
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')
...
...
flowspec/models.py
View file @
f12b3d54
...
...
@@ -75,6 +75,7 @@ class ThenAction(models.Model):
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
)
...
...
templates/apply.html
View file @
f12b3d54
...
...
@@ -148,7 +148,7 @@ th {
}
.accord_wrapper
{
height
:
100%
!important
;
height
:
452px
!important
;
}
.help
{
...
...
@@ -229,7 +229,7 @@ th {
</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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment