Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#10038 closed (fixed)

BaseModelFormSet's method save_existing_objects uses form.changed_data instead of form.has_changed()

Reported by: karihre Owned by: nobody
Component: Forms Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The method save_existing_objects uses form.changed_data in an if statement instead of form.has_changed() (which only does bool(self.changed_data) ) not enabling people to overload the has_changed() method for custom behavior.

The method save_new_objects in the same class uses the has_changed() method for the same purpose so I can't figure out why it is done differently in the save_existing_objects method.

I have attached a patch to fix this.

Thank you!

Attachments (1)

has_changed.diff (582 bytes) - added by karihre 5 years ago.

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by karihre

comment:1 Changed 5 years ago by jacob

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by Alex

  • Triage Stage changed from Accepted to Ready for checkin

comment:3 Changed 5 years ago by jacob

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

(In [10495]) Fixed #10038: make BaseModelFormSet.save_existing_objects use Form.has_changed() instead of looking at changed_data directly. Thanks, karihre.

comment:4 Changed 5 years ago by jacob

(In [10496]) [1.0.X] Fixed #10038: make BaseModelFormSet.save_existing_objects use Form.has_changed() instead of looking at changed_data directly. Thanks, karihre. Backport of r10495 from trunk.

comment:5 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.