Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#24841 closed Bug (fixed)

BaseRangeField should use base_field's prepare_value method

Reported by: Villiers Strauss Owned by: Villiers Strauss
Component: contrib.postgres Version: 1.8
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: yes UI/UX: no


The BaseRangeField doesn't do the base_field's prepare_value method on the submitted range values, so the base field preparations are not applied to the values.

For the basic types, this isn't a problem, but for DateTimeRangeField it is, because the DateTimeField (DateTimeRangeField's base_field) does a timezone conversion on the submitted values, but DateTimeRangeField leaves the timezone as is.

What then happens is that datetimes displayed by the field are in UTC, but they are submitted as the local timezone.

Change History (5)

comment:1 by Villiers Strauss, 9 years ago

Owner: set to Villiers Strauss
Status: newassigned

comment:3 by Tim Graham, 9 years ago

Patch needs improvement: set
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:4 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 614bec41:

Fixed #24841 -- Made BaseRangeField.prepare_value() call base_field's prepare_value()

comment:5 by Tim Graham <timograham@…>, 9 years ago

In 4311fd2c:

[1.8.x] Fixed #24841 -- Made BaseRangeField.prepare_value() call base_field's prepare_value()

Backport of 614bec41b5306b32b8de20d66f047ff8d6f35256 from master

Note: See TracTickets for help on using tickets.
Back to Top