Skip to content

Document how actors are displayed#2792

Open
cycsmail wants to merge 1 commit into
simonw:mainfrom
cycsmail:document-how-actors-are-displayed
Open

Document how actors are displayed#2792
cycsmail wants to merge 1 commit into
simonw:mainfrom
cycsmail:document-how-actors-are-displayed

Conversation

@cycsmail

Copy link
Copy Markdown

Closes:

Datasette uses display_actor() to choose a short label for the current actor in places like the navigation menu and the /-/logout page, but that behaviour wasn't documented anywhere. This adds a "How actors are displayed" section to the authentication docs that spells out the display / name / username / login / id key order it looks through and the str(actor) fallback when none are set.

I also added a test in tests/test_docs.py that reads the key tuple straight from display_actor and asserts each key is mentioned in the new docs section, so the docs and the code can't quietly drift apart. The test_docs.py tests pass, and the new test fails if the docs section is removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant