soynatan / django-easy-audit

Yet another Django audit log app, hopefully the simplest one.
GNU General Public License v3.0
735 stars 182 forks source link

Related IDs do not work with UUIDs #221

Closed MaehMaeh closed 2 years ago

MaehMaeh commented 2 years ago

The m2m_changed signal method throws an error (Object of type UUID is not JSON serializable) if UUIDs are used for the IDs. If the DjangoJSONEncoder is used, the error does not occur.

signals/model_signals.py

object_json_repr = json.dumps(tmp_repr, cls=DjangoJSONEncoder)

instead of

object_json_repr = json.dumps(tmp_repr)
jberends commented 2 years ago

We do encounter this same problem as well on our database where we use UUID's as primary keys all over when processing signals asynchronously through celery. Our error logs (to sentry.io) is filling up because of this. Can we put this into a release soon? See #223

KaczuH commented 2 years ago

@jheld Thank you for merging it in! :heart: :rocket: