Repository navigation
Hide labels outside a choice field's choices and harden workflows - #19
Merged
Merged
Conversation
Render labels on a field with choices only for keys among them, and document that a field without choices, such as a CharField, can't hide labels for submitted keys. Give the test workflow a read-only token, pin actions to commit SHAs, stop persisting checkout credentials, and publish to PyPI from a pypi environment without the dependency cache.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes from a security review of the project.
Labels for rejected keys on choice fields
When a bound form is re-rendered,
LookupWidgetshows a label for each submitted key. On aModelChoiceFieldthose labels already go through the field's queryset, so a key the field rejects never shows its label. On a field with plainchoices, nothing checked them: anyone could submit any key and read its label fromget_selectedon the error page.choices. Option groups and choices given as a callable are handled too.CharField, gives the widget nothing to check against.docs/private-data.mdnow says so, and recommends a model or choice field for private data.docs/usage.mdlinks to it.GitHub workflows
persist-credentials: falseon every checkout.testing.ymla read-only token (permissions: contents: read).pypienvironment, and turn off the uv cache there so a restored cache can't end up in a release.