Skip to content

Commit 19c2642

Browse files
benedikt-bartscheradhami3310
authored andcommitted
fix: allow multiple middleware postprocess update mutations (#4970)
1 parent 23d01e8 commit 19c2642

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

reflex/app_mixins/middleware.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ async def _postprocess(
7474
Returns:
7575
The state update to return.
7676
"""
77+
out = update
7778
for middleware in self._middlewares:
7879
if asyncio.iscoroutinefunction(middleware.postprocess):
7980
out = await middleware.postprocess(
@@ -89,6 +90,4 @@ async def _postprocess(
8990
event=event,
9091
update=update,
9192
)
92-
if out is not None:
93-
return out # pyright: ignore [reportReturnType]
94-
return update
93+
return out # pyright: ignore[reportReturnType]

0 commit comments

Comments
 (0)