openfoodfacts / open-prices

An open database of prices 🧾💸💰🏷️🤑🍽️
https://prices.openfoodfacts.org
GNU Affero General Public License v3.0
42 stars 12 forks source link

Refactor model validation on save #553

Open raphodn opened 2 weeks ago

raphodn commented 2 weeks ago

What

We currently override the model save/full_clean step, to add model-level validation. There are many rules and cases (new object or editing).

I think it would be better to move this in a seperate file.

We could also leverage https://github.com/romgar/django-dirtyfields ?