Created
February 28, 2025 22:20
-
-
Save orian/b5efd39c793b97c4ca046ee0c662d762 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TeamConcurrentThrottle(BaseThrottle): | |
def allow_request(self, request, view): | |
personal_api_key = PersonalAPIKeyAuthentication.find_key_with_source(request) | |
if request.user.is_authenticated and personal_api_key is None: | |
return True | |
team_id = PersonalApiKeyRateThrottle.safely_get_team_id_from_view(view) | |
if team_id is None: | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment