Skip to content

Commit

Permalink
Refactor get_cacke_key for SubmissionURLThrottle class
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankApiyo committed Aug 24, 2024
1 parent 8173ae7 commit 0628b51
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions onadata/libs/throttle.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ def get_form_owner_or_project_from_url(self, url):
return None

def get_cache_key(self, request, _):
form_owner_or_project = self.get_form_owner_or_project_from_url(request.path)
if (form_owner_or_project and
request.method == 'POST'
and '/submission' in request.path):
if (request.method == 'POST' and '/submission' in request.path
and self.get_form_owner_or_project_from_url(request.path)):
return f"throttle_method_{request.method}_path_{request.path}"
return None

Expand Down

0 comments on commit 0628b51

Please sign in to comment.