Skip to content

Update score and gallery `modified_by` when editing related models

Sivert Olstad requested to merge update-modified-by-in-all-views into main

Closes #164 (closed)

Uploading images to a gallery, and editing the PDFs and parts of a score, should count as editing the gallery or score itself, as these related models are a part of the parent model.

This should also apply to PdfsUpload, but that's a can of worms I'm too afraid to open. The multithreading does not work with transactions out-of-the-box.

This PR also does some light refactoring to the touched sheetmusic views. I've dropped mixins in favour of FormView, and overridden get_object to save the object in a variable, then use that variable in the future. I think this is cleaner than overriding get or post for the same purpose, especially since it means you can always call get_object instead of having to make a decision between that function and the variable.

Merge request reports