Validation Error results in blank reversion comment
See original GitHub issueSteps to reproduce:
- Create an Admin model and inherit from
VersionAdmin
. - Add an
inlineModelAdmin
object. - Try editing the object to get a
ValidationError
. - Click on the
history
button of the model admin and you would notice a version with emptyaction
field.
If it’s not a bug, is there a way to not store/display these versions in the history
tab.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
c# - I need to return customized validation result (response) in ...
1 Answer 1 · Create custom ValidationError model which contains the returned fields: · Create custom IActionResult. · Create Custom Action Filter ...
Read more >Chapter 13 – Working with Excel Spreadsheets
Open multiple Excel files and compare data between spreadsheets. Check whether a spreadsheet has blank rows or invalid data in any cells and...
Read more >Swap Data Recordkeeping and Reporting Requirements
C. § 49.10—Acceptance and Validation of Data. V. Swap Data Elements Reported to Swap Data Repositories. A. Proposal. B. Comments on the ...
Read more >NVMe Command Line Interface (NVMe-CLI) – NVM Express
It supports NVMe SSDs as well as NVMe™ over Fabrics (NVMe-oF™) architecture and offers optional vendor plugins for supplemental information ...
Read more >Method 1668A Interlaboratory Validation Study Report - EPA
This report presents the results of EPA's interlaboratory validation of EPA Method 1668A. Chlorinated Biphenyl Congeners in Water, Soil, Sediment, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Are you using a 3rd party admin subclass?
The reason I ask, is that django-reversion will only create a revision if a model is created/updated within the admin view. Under normal operation, if an admin form raises a validation error, no models will be saved, so no revision will be created.
In your case, it seems that somehow something is being saved, despite the validation error being raised.
It would be useful to see what is inside these revisions with empty comments. Get the ID of the revision by loading it up and looking in the browser URL bar. Then using the ./manage.py shell, try:
from reversion.models import Revision revision = Revision.objects.get(id=your_empty_revision_id) print(v.object for v in revision.version_set.all())
That’ll show you all the model snapshots saved in the revision, and we’ll get to the bottom of what’s causing this issue.
On Wed, 30 Jun 2021 at 03:26, SiddChugh @.***> wrote:
Hey, you were right. I was saving the object somewhere else before throwing a validation error in my view. Closing the ticket.