mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 20:45:44 +00:00
More fixes
- Add a set of template tags for rendering status codes - Improve build API filtering - Remove some outdated files - Fix unit testing
This commit is contained in:
@ -38,7 +38,6 @@ class BuildList(generics.ListCreateAPIView):
|
||||
]
|
||||
|
||||
filter_fields = [
|
||||
'part',
|
||||
]
|
||||
|
||||
def get_queryset(self):
|
||||
@ -49,6 +48,12 @@ class BuildList(generics.ListCreateAPIView):
|
||||
|
||||
build_list = super().get_queryset()
|
||||
|
||||
# Filter by part
|
||||
part = self.request.query_params.get('part', None)
|
||||
|
||||
if part is not None:
|
||||
build_list = build_list.filter(part=part)
|
||||
|
||||
# Filter by build status?
|
||||
status = self.request.query_params.get('status', None)
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load status_codes %}
|
||||
|
||||
{% block page_title %}
|
||||
InvenTree | Build - {{ build }}
|
||||
@ -23,7 +25,6 @@ InvenTree | Build - {{ build }}
|
||||
</div>
|
||||
<div class='media-body'>
|
||||
<h4>Build Details</h4>
|
||||
|
||||
<p>
|
||||
<div class='btn-row'>
|
||||
<div class='btn-group'>
|
||||
@ -50,7 +51,7 @@ InvenTree | Build - {{ build }}
|
||||
<table class='table table-striped table-condensed'>
|
||||
<tr>
|
||||
<td>{{ build.title }}</td>
|
||||
<td>{% include "build_status.html" with build=build %}</td>
|
||||
<td>{% build_status build.status %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Part</td>
|
||||
|
@ -2,6 +2,7 @@
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% block details %}
|
||||
{% load status_codes %}
|
||||
|
||||
{% include "build/tabs.html" with tab='details' %}
|
||||
|
||||
@ -39,7 +40,7 @@
|
||||
<tr>
|
||||
<td><span class='fas fa-info'></span></td>
|
||||
<td>{% trans "Status" %}</td>
|
||||
<td>{% include "build_status.html" with build=build %}</td>
|
||||
<td>{% build_status build.status %}</td>
|
||||
</tr>
|
||||
{% if build.batch %}
|
||||
<tr>
|
||||
|
@ -143,9 +143,7 @@ class TestBuildViews(TestCase):
|
||||
|
||||
content = str(response.content)
|
||||
|
||||
# Content should contain build titles
|
||||
for build in Build.objects.all():
|
||||
self.assertIn(build.title, content)
|
||||
self.assertIn("Part Builds", content)
|
||||
|
||||
def test_build_detail(self):
|
||||
""" Test the detail view for a Build object """
|
||||
|
Reference in New Issue
Block a user