1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-23 07:52:23 +00:00

Update JSON

This commit is contained in:
Yohann D'ANELLO 2020-02-27 14:59:01 +01:00
parent 2f51057f4c
commit 12ddfad254

View File

@ -60,9 +60,8 @@ def save_object(sender, instance, **kwargs):
user, ip = get_user_and_ip(sender)
from rest_framework.renderers import JSONRenderer
previous_json = JSONRenderer().render(previous)
instance_json = JSONRenderer().render(instance)
previous_json = serializers.serialize('json', previous)[1:-1] if previous.exists else None
instance_json = serializers.serialize('json', [instance, ])[1:-1]
Changelog.objects.create(user=user,
ip=ip,
model=ContentType.objects.get_for_model(instance),