Skip to content

Conversation

@SergeiJp
Copy link
Contributor

The generator for TextField doesn't respect the max_length set in the model field.
As a result, validating the model through the serializer causes a validation error.

Switch to use gen_string instead of gen_text which respect the max_length and also support MAX_LENGTH constant
if max_length is not set on the field

PR Checklist

  • Change is covered with tests
  • CHANGELOG.md is updated if needed

Copy link
Member

@amureki amureki left a comment

Choose a reason for hiding this comment

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

Greetings @SergeiJp

Thank you for the contribution, this is very valuable!
I left a small comment on the code; otherwise I think we can proceed with the change. 👍

@SergeiJp SergeiJp requested a review from amureki August 20, 2024 02:31
Copy link
Member

@amureki amureki left a comment

Choose a reason for hiding this comment

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

Great, thank you for the contribution! 🏅

@amureki amureki merged commit ef21347 into model-bakers:main Aug 20, 2024
@amureki
Copy link
Member

amureki commented Aug 20, 2024

Released in 1.19.4

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.

2 participants