Fix message_type in documentation, closes #1689

This commit is contained in:
Simon Willison 2022-03-26 13:51:20 -07:00 committed by GitHub
commit bd8a58ae61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -458,8 +458,8 @@ Returns the original, decoded object that was passed to :ref:`datasette_sign`. I
.. _datasette_add_message:
.add_message(request, message, message_type=datasette.INFO)
-----------------------------------------------------------
.add_message(request, message, type=datasette.INFO)
---------------------------------------------------
``request`` - Request
The current Request object
@ -467,7 +467,7 @@ Returns the original, decoded object that was passed to :ref:`datasette_sign`. I
``message`` - string
The message string
``message_type`` - constant, optional
``type`` - constant, optional
The message type - ``datasette.INFO``, ``datasette.WARNING`` or ``datasette.ERROR``
Datasette's flash messaging mechanism allows you to add a message that will be displayed to the user on the next page that they visit. Messages are persisted in a ``ds_messages`` cookie. This method adds a message to that cookie.