django-easy-audit icon indicating copy to clipboard operation
django-easy-audit copied to clipboard

Literal string 'null' stored in changed_field

Open jameskirsop opened this issue 5 years ago • 7 comments

I'm seeing a literal string of 'null' being stored in the database against some Update events.

If there aren't any changed fields one of the following should be occurring instead:

  1. The event isn't logged as an 'Update' at all - as nothing has changed on the object
  2. The changed_fields column should be left empty - null - instead of 'null'.

This bug makes it tedious to .filter() for actual changes to a given object.

jameskirsop avatar Jul 17 '19 02:07 jameskirsop

I would opt for number 1. @soynatan @jheld, what do you think about this?

guy881 avatar Oct 10 '19 10:10 guy881

Number 1 is addressed now with https://github.com/soynatan/django-easy-audit/pull/106.

gghildyal avatar Oct 26 '19 09:10 gghildyal

Would appreciate if @gghildyal's PR could be merged into master!

jameskirsop avatar Jan 29 '20 01:01 jameskirsop

I'm happy with option 1, as well. Likely to merge #106 shortly.

If option 1 has any process issues for certain projects, then we can enable a new setting which allows doing the update and saving it as NULL instead. But for now, simpler seems better.

jheld avatar Feb 02 '20 14:02 jheld

merged and released to PyPI as 1.2.2b1.

there might be a couple other changes in this release so I'm not marking as release candidate yet. Once we've frozen 1.2.2's changeset, we'll do (probably just 1) release candidate, and then after small testing, official release.

jheld avatar Feb 02 '20 15:02 jheld

Thanks @jheld!

jameskirsop avatar Feb 02 '20 20:02 jameskirsop

Still having this issue. I'm on version 1.3.3a3

alsichel avatar Feb 05 '24 19:02 alsichel