Skip to main content

get_flashed_messages

Pulls all flashed messages from the session and returns them. Further calls in the same request to the function will return the same messages. By default just the messages are returned, but when with_categories is set to True, the return value will be a list of tuples in the form (category, message) instead.

def get_flashed_messages(
with_categories: bool = False,
category_filter: t.Iterable[str] = ()
) - > list[str] | list[tuple[str, str]]

Pulls all flashed messages from the session and returns them. Further calls in the same request to the function will return the same messages. By default just the messages are returned, but when with_categories is set to True, the return value will be a list of tuples in the form (category, message) instead.

Parameters

NameTypeDescription
with_categoriesbool = FalseWhether to return the message category along with the message text as a tuple.
category_filtert.Iterable[str] = ()An iterable of category names used to restrict the returned messages to only those matching the specified categories.

Returns

TypeDescription
`list[str]list[tuple[str, str]]`