Opened 8 years ago

Closed 8 years ago

#7212 closed (fixed)

save_base() alters data, and can be called from templates

Reported by: Marty Alchin Owned by: Marty Alchin
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


In [7221], save() was changed to just be a call to save_base(), making subclassing easier, but the alters_data attribute never made it onto save_base(). Since save_base() can (and usually is) called without arguments, this means that templates that receive an object can use {{ obj.save_base }} and commit to the database, when that shouldn't be allowed.

Attachments (1)

save_base.alters_data.diff (523 bytes) - added by Marty Alchin 8 years ago.
Added alter_data to Model.save_base()

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by Marty Alchin

Attachment: save_base.alters_data.diff added

Added alter_data to Model.save_base()

comment:1 Changed 8 years ago by Gary Wilson

Resolution: fixed
Status: newclosed

(In [7526]) Fixed #7212 -- Added alters_data attribute to Model.save_base method, thanks Gulopine.

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