Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
streams: Clean up compose_views logic.
Tim Abbott3fdfbb27f9f3
diff --git a/zerver/views/streams.py b/zerver/views/streams.pyindex 7c839be96f9..b002035584b 100644--- a/zerver/views/streams.py+++ b/zerver/views/streams.py@@ -361,17 +361,12 @@ def compose_views(thunks: List[Callable[[], HttpResponse]]) -> HttpResponse:everything goes right. (This helps clients avoid extra latencyhops.) It rolls back the transaction when things go wrong in anyone of the composed methods.-- TODO: Move this a utils-like module if we end up using it more widely.-"""json_dict: Dict[str, Any] = {}with transaction.atomic():for thunk in thunks:response = thunk()- if response.status_code != 200:- raise JsonableError(response.content) # nocoveragejson_dict.update(orjson.loads(response.content))return json_success(json_dict)