Opened 20 months ago

Closed 20 months ago

Last modified 20 months ago

#20781 closed Bug (fixed)

Regression in form field _has_changed for fields with show_hidden_initial=True

Reported by: timo Owned by: nobody
Component: Forms Version: 1.6-beta-1
Severity: Release blocker Keywords:
Cc: claudep Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Following [892bc91cb0] (affects 1.6.X), the date_joined and last_login fields always appear as "Changed" when editing a user in the admin. It looks like it affects fields with callable defaults. In this case, django.forms.fields.Field._has_changed returns False because initial_value is a string and data_value is a datetime.

I discovered this working on #19019, the PR contains some TODOs which could be used as a regression test once this is fixed.

Change History (5)

comment:1 Changed 20 months ago by claudep

  • Cc claudep added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Severity changed from Normal to Release blocker
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 20 months ago by claudep

  • Has patch set

comment:3 Changed 20 months ago by timo

  • Triage Stage changed from Accepted to Ready for checkin

It does, thanks for looking into it!

comment:4 Changed 20 months ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 02b0106d43f6997f02cc6785359f8f7519215d3d:

Fixed #20781 -- Fixed _has_changed regression with MultiValueField

Thanks Tim Graham for the report.

comment:5 Changed 20 months ago by Claude Paroz <claude@…>

In 816bf0c6a7a13efb7ae17c9773f984f2dd16fc72:

[1.6.x] Fixed #20781 -- Fixed _has_changed regression with MultiValueField

Thanks Tim Graham for the report.
Backport of 02b0106d from master.

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