mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
request: Refactor ZulipRequestNotes to RequestNotes.
This utilizes the generic `BaseNotes` we added for multipurpose patching. With this migration as an example, we can further support more types of notes to replace the monkey-patching approach we have used throughout the codebase for type safety.
This commit is contained in:
@@ -42,10 +42,10 @@ class RateLimitedObject(ABC):
|
||||
)
|
||||
|
||||
def rate_limit_request(self, request: HttpRequest) -> None:
|
||||
from zerver.lib.request import get_request_notes
|
||||
from zerver.lib.request import RequestNotes
|
||||
|
||||
ratelimited, time = self.rate_limit()
|
||||
request_notes = get_request_notes(request)
|
||||
request_notes = RequestNotes.get_notes(request)
|
||||
|
||||
request_notes.ratelimits_applied.append(
|
||||
RateLimitResult(
|
||||
|
||||
Reference in New Issue
Block a user