Fix {id} not working in send to device templates

This commit is contained in:
Kovid Goyal 2011-05-22 20:05:30 -06:00
commit a11d874403

View File

@ -926,8 +926,8 @@ class Device(DeviceConfig, DevicePlugin):
if not isinstance(template, unicode): if not isinstance(template, unicode):
template = template.decode('utf-8') template = template.decode('utf-8')
app_id = str(getattr(mdata, 'application_id', '')) app_id = str(getattr(mdata, 'application_id', ''))
# The db id will be in the created filename id_ = mdata.get('id', fname)
extra_components = get_components(template, mdata, fname, extra_components = get_components(template, mdata, id_,
timefmt=opts.send_timefmt, length=maxlen-len(app_id)-1) timefmt=opts.send_timefmt, length=maxlen-len(app_id)-1)
if not extra_components: if not extra_components:
extra_components.append(sanitize(self.filename_callback(fname, extra_components.append(sanitize(self.filename_callback(fname,