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
27be70f4
Commit
27be70f4
authored
Feb 11, 2021
by
ViolanteCodes
Browse files
finished callable get_rate_limit function
parent
fea9d619
Changes
1
Hide whitespace changes
Inline
Side-by-side
anonticket/views.py
View file @
27be70f4
...
...
@@ -115,11 +115,18 @@ class PassUserIdentifierMixin:
# Set rate-limiting variables as global variables with value of None.
# All items (groups/issues) currently share from same rate-limiting
# bucket. This may be changed in the future.
# bucket, which is set by RATE_GROUP. You can change this by using a
# different group name in the decorator or by not including a group name
# with requests.
RATE_GROUP
=
'tor-rate-group'
LIMIT_RATE
=
'0/m'
RATE_METHOD
=
[
'POST'
]
RATE_GROUP
=
settings
.
MAIN_RATE_GROUP
def
get_rate_limit
(
group
,
request
,
block_all
=
False
):
"""Callable function to get rate limit."""
if
block_all
==
True
:
return
'0/s'
else
:
return
settings
.
LIMIT_RATE
# ------------------SHARED FUNCTIONS, GITLAB---------------------------
# Easy to parse version of GitLab-Python functions.
...
...
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