Fix type annotation of message_dict. (#1073)

When message_dict is accessed, it either raises an `AttributeError` or
returns a `dict`. There is no way for it to be `Optional`.

caad462fea/django/core/exceptions.py (L170-L176)

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
PIG208
2022-07-23 09:55:58 -04:00
committed by GitHub
parent 3d8d900487
commit f3f80164a8

View File

@@ -44,7 +44,7 @@ class ValidationError(Exception):
params: Optional[Dict[str, Any]] = ...,
) -> None: ...
@property
def message_dict(self) -> Optional[Dict[str, List[str]]]: ...
def message_dict(self) -> Dict[str, List[str]]: ...
@property
def messages(self) -> List[str]: ...
def update_error_dict(self, error_dict: Dict[str, List[ValidationError]]) -> Dict[str, List[ValidationError]]: ...