Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

rest: Add assertions for entries from supported methods.

Zixuan James Lifcba35036b7d
diff --git a/zerver/lib/rest.py b/zerver/lib/rest.py
index 09671a8c2fc..be9f25806c3 100644
--- a/zerver/lib/rest.py
+++ b/zerver/lib/rest.py
@@ -90,7 +90,10 @@ def get_target_view_function_or_response(
if method_to_use in supported_methods:
entry = supported_methods[method_to_use]
if isinstance(entry, tuple):
- return entry
+ handler, view_flags = entry
+ assert callable(handler)
+ assert isinstance(view_flags, set)
+ return handler, view_flags
return supported_methods[method_to_use], set()
return json_method_not_allowed(list(supported_methods.keys()))