allow async signal receivers

This commit is contained in:
pgjones 2023-04-10 10:21:13 +01:00 committed by David Lord
parent a05c0c6b72
commit 8239765a44
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
5 changed files with 25 additions and 12 deletions

View file

@ -327,8 +327,10 @@ def flash(message: str, category: str = "message") -> None:
flashes = session.get("_flashes", [])
flashes.append((category, message))
session["_flashes"] = flashes
app = current_app._get_current_object() # type: ignore
message_flashed.send(
current_app._get_current_object(), # type: ignore
app,
_async_wrapper=app.ensure_sync,
message=message,
category=category,
)