When creating an export, set creator to current user
many exports won't support creation via web app, but some will
This commit is contained in:
parent
8c610e2142
commit
c8d6361c36
|
@ -133,6 +133,12 @@ class ExportMasterView(MasterView):
|
||||||
f.append('download')
|
f.append('download')
|
||||||
f.set_renderer('download', self.render_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):
|
def render_download(self, export, field):
|
||||||
path = self.get_file_path(export)
|
path = self.get_file_path(export)
|
||||||
text = "{} ({})".format(export.filename, self.readable_size(path))
|
text = "{} ({})".format(export.filename, self.readable_size(path))
|
||||||
|
|
Loading…
Reference in a new issue