Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#27223 closed Bug (duplicate)

model RangeField with default value are skiped in ModelForm full_clean validation in construct_instance function — at Version 4

Reported by: Dariusz Paluch Owned by: nobody
Component: Forms Version: 1.10
Severity: Release blocker Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Dariusz Paluch)

https://github.com/django/django/commit/4bc6b939944183533ae74791d21282e613f63a96
That change in construct_instance function makes a bug with custom
full_clean validation for *RangeField like fields

RangeField values are send in POST method by two key=value pair:
my_range_0=1&my_range_1=9
that there is not my_range field in POST so field value is skipped and
not copied to instance.

Change History (4)

comment:1 by Tim Graham, 8 years ago

Resolution: duplicate
Status: newclosed

RangeWidget is a subclass of MultiWidget so the patch for #27186 should fix this. Could you confirm?

In investigating the other widgets in contrib.postgres, I noticed that SplitArrayWidget needs to be fixed. I'll push an update to my PR shortly.

comment:2 by Dariusz Paluch, 8 years ago

Description: modified (diff)

comment:3 by Dariusz Paluch, 8 years ago

Yes, this patch fix this.
Thank you, and I waiting for 1.10.2 shortly

comment:4 by Dariusz Paluch, 8 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top