Closed brianhelba closed 3 years ago
I realized refactoring this was necessary as part of creating a Folder factory. It should be simpler to review as a separate change. I also think it's an improvement in its own right, as we now have fewer things happening via signals (which are hard to maintain) and more database constraints.
This pushes max folder depth enforcement to two extremes:
full_clean
(or Form validations)This also starts the expectation that at Folder instantiation, the choice of
parent
will be decided (eitherNone
or specified). Changing a Folder'sparent
after instantiation confers a responsibility to update all associated denormalized fields (e.g.depth
).