Opened 5 years ago

Closed 5 years ago

Last modified 5 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

Description

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 Changed 5 years ago by Villiers Strauss

Owner: set to Villiers Strauss
Status: newassigned

comment:2 Changed 5 years ago by Villiers Strauss

comment:3 Changed 5 years ago by Tim Graham

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

comment:4 Changed 5 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 614bec41:

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

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

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