mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
exceptions: Guard validation error conversion with message_dict.
Iterating over ValidatorError does not necessarily return a tuple. This uses the `message_dict` property on `ValidationError` instead to make sure that we always get a `dict` (it otherwise raises an `AttributeError` when the `dict` is not available). Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
committed by
Tim Abbott
parent
43106fb6ce
commit
3104a7ea94
@@ -471,4 +471,4 @@ class ValidationFailureError(JsonableError):
|
||||
|
||||
def __init__(self, error: ValidationError) -> None:
|
||||
super().__init__(error.messages[0])
|
||||
self.errors = dict(error)
|
||||
self.errors = error.message_dict
|
||||
|
||||
Reference in New Issue
Block a user