bruvellu / cifonauta

Marine biology image database by CEBIMar/USP
http://cifonauta.cebimar.usp.br
GNU General Public License v3.0
21 stars 5 forks source link

Keep taxon media and curations up-to-date on save #341

Closed bruvellu closed 3 weeks ago

bruvellu commented 2 months ago

When an invalid taxon is added, all the media is associated with the valid taxon. But this doesn't happen if media is linked to an existing valid taxon.

Similarly, when a taxon is added or updated, it should be automatically associated with a curation if it is a descendant of a taxon belonging to one.

Both issues can be solved by adding signals on pre or post save.

bruvellu commented 1 month ago

With 8f7ccfa1b9e32a837b84d498e1c43a148565d196, media from invalid taxon is added to valid taxon (and vice versa) before saving. However, removing media from one taxon won't remove it from the other. This feature requires better planning.

bruvellu commented 1 month ago

Ok, with 5afcd38eabd14c428d6974a861d2b48bab24bdef, I finally addressed this issue. Now, when a taxon is added, the curation from its ancestors is assigned to itself and its descendants. And, when a taxon is added to a curation, its descendants are also added to the curation.

There are a few edge cases that we'll need to work around, for now. For example, removing a subtaxon of an existing curation will remove itself and its descendants.

I've also taken the chance to standardize all the curation naming. There were several names referring to the same thing: curadoria, curadory, curatorship. I changed everything to: curation.

bruvellu commented 3 weeks ago

Done with 3a4ecd27b89ddfbb81fd15f0392650958245aa43 on this comment of #343.