Use label handler to avoid deprecated logic
This commit is contained in:
parent
32fc0415da
commit
ad5dec3dc6
|
@ -35,7 +35,7 @@
|
|||
% for name, display in printer.required_settings.items():
|
||||
<div class="field-wrapper">
|
||||
<label>${display}</label>
|
||||
<div class="field">${instance.get_printer_setting(name) or ''}</div>
|
||||
<div class="field">${label_handler.get_printer_setting(instance, name) or ''}</div>
|
||||
</div>
|
||||
% endfor
|
||||
</div>
|
||||
|
|
|
@ -78,6 +78,13 @@ class LabelProfileView(MasterView):
|
|||
# format
|
||||
f.set_type('format', 'codeblock')
|
||||
|
||||
def template_kwargs_view(self, **kwargs):
|
||||
kwargs = super(LabelProfileView, self).template_kwargs_view(**kwargs)
|
||||
|
||||
kwargs['label_handler'] = self.label_handler
|
||||
|
||||
return kwargs
|
||||
|
||||
def after_create(self, profile):
|
||||
self.after_edit(profile)
|
||||
|
||||
|
@ -97,7 +104,7 @@ class LabelProfileView(MasterView):
|
|||
node = colander.SchemaNode(colander.String(),
|
||||
name=name,
|
||||
title=label,
|
||||
default=profile.get_printer_setting(name))
|
||||
default=self.label_handler.get_printer_setting(profile, name))
|
||||
schema.add(node)
|
||||
|
||||
form = forms.Form(schema=schema, request=self.request,
|
||||
|
|
Loading…
Reference in a new issue