Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
TPA
Anonymous Ticket Portal
Commits
cb11864d
Commit
cb11864d
authored
Feb 11, 2021
by
ViolanteCodes
Browse files
added block_all = BLOCK_ALL to ip and form post decorators
parent
a9b29dc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
anonticket/views.py
View file @
cb11864d
...
...
@@ -125,6 +125,7 @@ class PassUserIdentifierMixin:
# IP and by key:post with Tor preferred settings applied.
RATE_GROUP
=
settings
.
MAIN_RATE_GROUP
BLOCK_ALL
=
settings
.
BLOCK_ALL
def
custom_ratelimit_ip
(
group
=
RATE_GROUP
,
...
...
@@ -132,7 +133,7 @@ def custom_ratelimit_ip(
rate
=
None
,
method
=
ratelimit
.
UNSAFE
,
block
=
True
,
block_all
=
False
block_all
=
BLOCK_ALL
,
):
"""Custom version of the @ratelimit decorator based on key='ip' and
callable rate function."""
...
...
@@ -173,7 +174,7 @@ def custom_ratelimit_post(
rate
=
None
,
method
=
ratelimit
.
UNSAFE
,
block
=
True
,
block_all
=
False
block_all
=
BLOCK_ALL
,
):
"""Custom version of the @ratelimit decorator with key='post' and
callable rate function."""
...
...
Write
Preview
Supports
Markdown
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