fix(blank/unique): add `default` handling for `blank=True` field
Description
This MR should fix the issue with blank=True field in UniqueTogether constraint. It should not become required all of a sudden.
Fixes https://github.com/encode/django-rest-framework/issues/9750
I have added tests similar to the tests added in https://github.com/encode/django-rest-framework/pull/9531
Hi @sshishov @auvipy @deepakangadi, I'm excited to contribute to DRF as my first contribution! I noticed this PR (#9751) addresses a critical issue (#9750) with blank=True fields in UniqueConstraints, which aligns with my experience in Django/DRF serializers and API optimization.
I can help unblock this by:
- Fixing the typo in
test_blank_uqnique_constraint_fields_are_not_required(uqnique→unique). - Splitting assertions in the test for clarity, as suggested by @deepakangadi.
- Adding char length limit (e.g.,
max_length=255) to the constraint. - Resolving conflicts by rebasing on
main. - Checking for overlap with PR #9725, as mentioned by @auvipy.
If this sounds good, I can start working on these changes. Should I update this branch (if permitted) or create a new PR? Thanks for your guidance!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.