Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make error_messages and default_error_messages types stricter #1592

Merged
merged 5 commits into from
Sep 2, 2023

Conversation

intgr
Copy link
Collaborator

@intgr intgr commented Jun 27, 2023

The values of these dicts/mappings should only be str or _StrPromise from lazy translation. Previously Any was accepted.

  • Typed error_messages= parameters as Mapping[str, _StrOrPromise] | None
  • Typed error_messages and default_error_messages class attributes as dict[str, _StrOrPromise]

Related issues

Previously discussed in #1538 (review)

Copy link
Member

@flaeppe flaeppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just ran across your mention for review. I think the changes here are fine.

@flaeppe flaeppe merged commit 3a1f139 into typeddjango:master Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants