You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
♻️(refacto) Unused scope attributes on DocumentThrottle and DocumentAccessThrottle #2865
DocumentThrottle.scope = "document" and DocumentAccessThrottle.scope = "document_access" are never used: DRF's ScopedRateThrottle.allow_request overwrites self.scope with view.throttle_scope before choosing the rate and the cache key.
"""Throttle for document access endpoints, except collaboration-server requests."""
scope="document_access"
They suggest the class carries its own scope, but a view or action using these classes without throttle_scope is not throttled at all (DRF lets every request through when the view has no scope). Today both viewsets set it (documents, accesses), so nothing is broken yet.
Suggested fix: remove the scope attributes and say in the docstrings that the scope and the rate come from the view's throttle_scope.
Activity
♻️(backend) remove the unused scope of the document throttles
♻️(backend) remove the unused scope of the document throttles