From c8d6361c36b3a0ca5bde7e73a765c7e026782fc7 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 5 Jul 2019 16:47:51 -0500 Subject: [PATCH] When creating an export, set creator to current user many exports won't support creation via web app, but some will --- tailbone/views/exports.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tailbone/views/exports.py b/tailbone/views/exports.py index 1125cde7..3d5762e3 100644 --- a/tailbone/views/exports.py +++ b/tailbone/views/exports.py @@ -133,6 +133,12 @@ class ExportMasterView(MasterView): f.append('download') f.set_renderer('download', self.render_download) + def objectify(self, form, data=None): + obj = super(ExportMasterView, self).objectify(form, data=data) + if self.creating: + obj.created_by = self.request.user + return obj + def render_download(self, export, field): path = self.get_file_path(export) text = "{} ({})".format(export.filename, self.readable_size(path))