Opened 7 years ago

Closed 7 years ago

#7212 closed (fixed)

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

Reported by: Gulopine Owned by: Gulopine
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation:
Needs tests: Patch needs improvement:
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 Gulopine 7 years ago.
Added alter_data to Model.save_base()

Download all attachments as: .zip

Change History (2)

Changed 7 years ago by Gulopine

Added alter_data to Model.save_base()

comment:1 Changed 7 years ago by gwilson

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

(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