handle missing printer in label profile templates

This commit is contained in:
Lance Edgar 2012-11-27 14:34:05 -08:00
parent b1faddd33e
commit 95096e0872
2 changed files with 3 additions and 3 deletions

View file

@ -16,7 +16,7 @@
% if form.updating: % if form.updating:
<% profile = form.fieldset.model %> <% profile = form.fieldset.model %>
<% printer = profile.get_printer() %> <% printer = profile.get_printer() %>
% if printer.required_settings: % if printer and printer.required_settings:
<li>${h.link_to("Edit Printer Settings", url('label_profile.printer_settings', uuid=profile.uuid))}</li> <li>${h.link_to("Edit Printer Settings", url('label_profile.printer_settings', uuid=profile.uuid))}</li>
% endif % endif
<li>${h.link_to("View this Label Profile", url('label_profile.read', uuid=profile.uuid))}</li> <li>${h.link_to("View this Label Profile", url('label_profile.read', uuid=profile.uuid))}</li>

View file

@ -6,7 +6,7 @@
<% profile = form.fieldset.model %> <% profile = form.fieldset.model %>
<% printer = profile.get_printer() %> <% printer = profile.get_printer() %>
<li>${h.link_to("Edit this Label Profile", url('label_profile.update', uuid=form.fieldset.model.uuid))}</li> <li>${h.link_to("Edit this Label Profile", url('label_profile.update', uuid=form.fieldset.model.uuid))}</li>
% if printer.required_settings: % if printer and printer.required_settings:
<li>${h.link_to("Edit Printer Settings", url('label_profile.printer_settings', uuid=profile.uuid))}</li> <li>${h.link_to("Edit Printer Settings", url('label_profile.printer_settings', uuid=profile.uuid))}</li>
% endif % endif
% endif % endif
@ -17,7 +17,7 @@ ${parent.body()}
<% profile = form.fieldset.model %> <% profile = form.fieldset.model %>
<% printer = profile.get_printer() %> <% printer = profile.get_printer() %>
% if printer.required_settings: % if printer and printer.required_settings:
<h2>Printer Settings</h2> <h2>Printer Settings</h2>
<div class="form"> <div class="form">