question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Validation Error results in blank reversion comment

See original GitHub issue

Steps 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 empty action field.

If it’s not a bug, is there a way to not store/display these versions in the history tab.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
etianencommented, Jun 30, 2021

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:

@etianen https://github.com/etianen any updates to what might be going wrong here?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/etianen/django-reversion/issues/877#issuecomment-871048789, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABEKCA4EZT3M5IZJMKNJTTTVJ6GJANCNFSM47OEC6LA .

0reactions
SiddChughcommented, Jul 29, 2021

Hey, you were right. I was saving the object somewhere else before throwing a validation error in my view. Closing the ticket.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found