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
Jean Michel Rouly
bookshare
Commits
fe747418
Commit
fe747418
authored
Apr 21, 2015
by
Daniel W Bond
Browse files
tightened down the ratelimiting
parent
ec35b6d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
bookshare/lookouts/views.py
View file @
fe747418
...
...
@@ -32,7 +32,7 @@ class CreateLookout(LoginRequiredMixin, CreateView):
return
context
@
ratelimit
(
key
=
'user'
,
rate
=
'5/m'
,
method
=
'POST'
,
block
=
True
)
@
ratelimit
(
key
=
'user'
,
rate
=
'
10
0/d'
,
method
=
'POST'
,
block
=
True
)
@
ratelimit
(
key
=
'user'
,
rate
=
'
5
0/d'
,
method
=
'POST'
,
block
=
True
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
return
super
(
CreateLookout
,
self
).
post
(
request
,
*
args
,
**
kwargs
)
...
...
bookshare/trades/views.py
View file @
fe747418
...
...
@@ -133,7 +133,7 @@ class CreateListing(LoginRequiredMixin, FormValidMessageMixin, CreateView):
return
context
@
ratelimit
(
key
=
'user'
,
rate
=
'5/m'
,
method
=
'POST'
,
block
=
True
)
@
ratelimit
(
key
=
'user'
,
rate
=
'
10
0/day'
,
method
=
'POST'
,
block
=
True
)
@
ratelimit
(
key
=
'user'
,
rate
=
'
5
0/day'
,
method
=
'POST'
,
block
=
True
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
return
super
(
CreateListing
,
self
).
post
(
request
,
*
args
,
**
kwargs
)
...
...
@@ -200,7 +200,7 @@ class ListingPage(LoginRequiredMixin, View):
@
ratelimit
(
key
=
'user'
,
rate
=
'5/m'
,
method
=
'POST'
,
block
=
True
)
# rate limit is higher for bids
@
ratelimit
(
key
=
'user'
,
rate
=
'
2
00/d'
,
method
=
'POST'
,
block
=
True
)
@
ratelimit
(
key
=
'user'
,
rate
=
'
1
00/d'
,
method
=
'POST'
,
block
=
True
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
view
=
CreateBid
.
as_view
()
return
view
(
request
,
*
args
,
**
kwargs
)
...
...
@@ -257,8 +257,8 @@ class CreateFlag(LoginRequiredMixin, CreateView):
context
[
'my_form'
]
=
form
return
context
# no daily limit because we want people to flag everything they need to
@
ratelimit
(
key
=
'user'
,
rate
=
'5/m'
,
method
=
'POST'
,
block
=
True
)
@
ratelimit
(
key
=
'user'
,
rate
=
'100/d'
,
method
=
'POST'
,
block
=
True
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
return
super
(
CreateFlag
,
self
).
post
(
request
,
*
args
,
**
kwargs
)
...
...
@@ -421,7 +421,7 @@ class SellListing(LoginRequiredMixin, FormValidMessageMixin, UpdateView):
return
context
@
ratelimit
(
key
=
'user'
,
rate
=
'5/m'
,
method
=
'POST'
,
block
=
True
)
@
ratelimit
(
key
=
'user'
,
rate
=
'
10
0/d'
,
method
=
'POST'
,
block
=
True
)
@
ratelimit
(
key
=
'user'
,
rate
=
'
5
0/d'
,
method
=
'POST'
,
block
=
True
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
return
super
(
SellListing
,
self
).
post
(
request
,
*
args
,
**
kwargs
)
...
...
@@ -486,7 +486,7 @@ class UnSellListing(LoginRequiredMixin, FormValidMessageMixin, UpdateView):
return
context
@
ratelimit
(
key
=
'user'
,
rate
=
'5/m'
,
method
=
'POST'
,
block
=
True
)
@
ratelimit
(
key
=
'user'
,
rate
=
'
10
0/d'
,
method
=
'POST'
,
block
=
True
)
@
ratelimit
(
key
=
'user'
,
rate
=
'
5
0/d'
,
method
=
'POST'
,
block
=
True
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
return
super
(
UnSellListing
,
self
).
post
(
request
,
*
args
,
**
kwargs
)
...
...
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