From 5e37a2d2227473df6fc9a5ba61994a0abb43eba4 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 12 Mar 2017 22:01:32 +0200 Subject: [PATCH] add upload to changelog --- pandora/archive/views.py | 13 +++++++++++++ pandora/document/views.py | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 941af83d0..b1c9ca0e2 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -284,6 +284,13 @@ def firefogg_upload(request): if f.item.rendered and f.selected: Item.objects.filter(id=f.item.id).update(rendered=False) Task.start(f.item, request.user) + add_changelog({ + 'user': request.user, + 'action': 'upload', + }, { + 'profile': profile, + 'item': f.item.public_id, + }, f.oshash) response = { 'uploadUrl': '/api/upload/?id=%s&profile=%s' % (f.oshash, profile), 'url': request.build_absolute_uri('/%s' % f.item.public_id), @@ -341,6 +348,12 @@ def direct_upload(request): file.uploading = True file.save() Task.start(file.item, request.user) + add_changelog({ + 'user': request.user, + 'action': 'upload', + }, { + 'item': file.item.public_id, + }, file.oshash) upload_url = '/api/upload/direct/?id=%s' % file.oshash return render_to_json_response({ 'uploadUrl': upload_url, diff --git a/pandora/document/views.py b/pandora/document/views.py index 41d6ffeac..700527fc0 100644 --- a/pandora/document/views.py +++ b/pandora/document/views.py @@ -417,6 +417,13 @@ def upload(request): file.save() else: return render_to_json_response(response) + add_changelog({ + 'user': request.user, + 'action': 'uploadDocument', + }, { + 'name': name, + 'extension': extension + }, file.get_id()) upload_url = '/api/upload/document?id=%s' % file.get_id() return render_to_json_response({ 'uploadUrl': upload_url,