Fix batch file download link URL
This commit is contained in:
parent
6febd01e76
commit
ac5a6c011b
|
@ -1387,15 +1387,7 @@ class FileBatchMasterView(BatchMasterView):
|
||||||
f.set_type('filename', 'file')
|
f.set_type('filename', 'file')
|
||||||
else:
|
else:
|
||||||
f.set_readonly('filename')
|
f.set_readonly('filename')
|
||||||
f.set_renderer('filename', self.render_filename)
|
f.set_renderer('filename', self.render_downloadable_file)
|
||||||
|
|
||||||
def render_filename(self, batch, field):
|
|
||||||
filename = getattr(batch, field)
|
|
||||||
if not filename:
|
|
||||||
return ""
|
|
||||||
path = batch.filepath(self.rattail_config, filename=filename)
|
|
||||||
url = self.get_action_url('download', batch)
|
|
||||||
return self.render_file_field(path, url)
|
|
||||||
|
|
||||||
|
|
||||||
class ToggleComplete(colander.MappingSchema):
|
class ToggleComplete(colander.MappingSchema):
|
||||||
|
|
Loading…
Reference in a new issue