Bug fix for build allocation

- If the part did not have an image file the template failed to render
This commit is contained in:
Oliver Walters 2019-05-14 18:31:19 +10:00
parent 9986df2074
commit 46ab6e40eb
2 changed files with 3 additions and 3 deletions

View File

@ -22,8 +22,8 @@ Automatically allocate stock to this build?
<tr>
<td>
<a class='hover-icon'>
<img class='hover-img-thumb' src='{{ item.stock_item.part.image.url }}'>
<img class='hover-img-large' src='{{ item.stock_item.part.image.url }}'>
<img class='hover-img-thumb' src='{% if item.stock_item.part.image %}{{ item.stock_item.part.image.url }}{% endif %}'>
<img class='hover-img-large' src='{% if item.stock_item.part.image %}{{ item.stock_item.part.image.url }}{% endif %}'>
</a>
</td>
<td>

View File

@ -101,7 +101,7 @@ class BuildAutoAllocate(AjaxUpdateView):
context['build'] = build
context['allocations'] = build.getAutoAllocations()
except Build.DoesNotExist:
context['error'] = 'No matching buidl found'
context['error'] = 'No matching build found'
return context