feat(core): call models clean method prior to saving model to DB

ref: #426 #433
This commit is contained in:
2024-12-20 14:01:54 +09:30
parent c649dc7669
commit 14f1935b77
2 changed files with 4 additions and 0 deletions

View File

@ -172,6 +172,8 @@ class SaveHistory(models.Model):
is the data that was saved to the DB.
"""
self.clean()
before = {}
try:

View File

@ -52,6 +52,8 @@ All models must meet the following requirements:
- Attribute `table_fields` is defined with the fields to display by default for viewing the model within a table.
- `clean()` method within a model is **only** used to ensure that the data entered into the DB is valid and/or to ensure application wide changes/validation is conducted prior to saving model.
## Checklist