mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
narrows: Validate negated field.
This commit is contained in:
@@ -554,10 +554,15 @@ def narrow_parameter(json: str) -> OptionalNarrowListT:
|
|||||||
else:
|
else:
|
||||||
operand_validator = check_string
|
operand_validator = check_string
|
||||||
|
|
||||||
validator = check_dict([
|
validator = check_dict(
|
||||||
|
required_keys=[
|
||||||
('operator', check_string),
|
('operator', check_string),
|
||||||
('operand', operand_validator),
|
('operand', operand_validator),
|
||||||
])
|
],
|
||||||
|
optional_keys=[
|
||||||
|
('negated', check_bool),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
validator('elem', elem)
|
validator('elem', elem)
|
||||||
|
|||||||
Reference in New Issue
Block a user