mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
exceptions: RateLimited shouldn't inherit from PermissionDenied.
We will want to raise RateLimited in authenticate() in rate limiting code - Django's authenticate() mechanism catches PermissionDenied, which we don't want for RateLimited. We want RateLimited to propagate to our code that called the authenticate() function.
This commit is contained in:
committed by
Tim Abbott
parent
a6a2d70320
commit
335b804510
@@ -2,7 +2,6 @@ from enum import Enum
|
||||
from typing import Any, Dict, List, Type, TypeVar, Optional
|
||||
from typing_extensions import NoReturn
|
||||
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
|
||||
@@ -179,7 +178,7 @@ class InvalidMarkdownIncludeStatement(JsonableError):
|
||||
def msg_format() -> str:
|
||||
return _("Invalid markdown include statement: {include_statement}")
|
||||
|
||||
class RateLimited(PermissionDenied):
|
||||
class RateLimited(Exception):
|
||||
def __init__(self, msg: str="") -> None:
|
||||
super().__init__(msg)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user