Allow min_length==0 for Column.Text fields#722
Conversation
|
Hi @HaraldNordgren, thanks for your contribution! In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. Sincerely, |
|
Thanks for the PR! I'd like to add a test or two, but after that, I can merge after you've signed the CLA. I've created a JIRA ticket and marked it for inclusion in 3.9, our next release. |
|
Sorry, I've jumped the gun in my reply. We've had some discussion about how to address this and are discussing other possible APIs for this solution. We may not get to this before our next release. Still, please sign the CLA so if we decide to implement this solution, we can merge quickly. Thanks! |
|
Thank you @HaraldNordgren for signing the Contribution License Agreement. Cheers, |
|
Could someone merge or close this one? |
| """ | ||
| self.min_length = ( | ||
| 1 if not min_length and kwargs.get('required', False) | ||
| 1 if min_length is not None and kwargs.get('required', False) |
There was a problem hiding this comment.
I think it should be 1 if min_length is None and kwargs.get('required', False)
beltran
left a comment
There was a problem hiding this comment.
@HaraldNordgren wdyt about my previous comment?
5be180b to
5d3d47b
Compare
|
@bjmb Yes, I think your comment probably makes sense. I haven't worked with this code in a long while, but looking at it now I'm guessing that was a simple mistake on my part. |
|
@mambocab I like tests, but I'm not quite sure where to begin with this one. Setting |
|
Thanks. Added a minimal value test here: 32037f3 |
Current behaviour treats 0 as not specified at all. If this is not on purpose we should check for
Noneexplicitly instead to allow us to store empty strings in the database.