RISPaDD / biospecdb

Biosample Spectral Repository
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Fail early in model.full_clean so field validators bubble up #333

Closed jamienoss closed 7 months ago

jamienoss commented 7 months ago

Resolves #332

My understanding from the Django docs is that ModelForm should pull the validators from the model fields such that when the form is validated, the field validators are called. This does not seem to happen.

250 approached this before, however, it still relied on the field validators running.

Changes:

codecov[bot] commented 7 months ago

Codecov Report

Attention: Patch coverage is 81.66667% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 90.73%. Comparing base (e1bf207) to head (b6a4501).

Files Patch % Lines
biospecdb/apps/uploader/base_models.py 78.04% 9 Missing :warning:
biospecdb/apps/uploader/models.py 80.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #333 +/- ## ========================================== - Coverage 91.07% 90.73% -0.34% ========================================== Files 28 28 Lines 2184 2235 +51 ========================================== + Hits 1989 2028 +39 - Misses 195 207 +12 ``` | [Flag](https://app.codecov.io/gh/RISPaDD/biospecdb/pull/333/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RISPaDD) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/RISPaDD/biospecdb/pull/333/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RISPaDD) | `90.73% <81.66%> (-0.34%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RISPaDD#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.