Skip to content

Commit

Permalink
Merge pull request #96 from avbasov/optimize-job-page
Browse files Browse the repository at this point in the history
Add prefetch test__bugs for job page
  • Loading branch information
and-sm committed May 8, 2022
2 parents 8133732 + 189fb3c commit 390b9af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions main/templates/main/job.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ <h4>Tests: {{ test_count }}</h4>
</tr>
</thead>
<tbody id="tests_list">
{% for item in tests.all %}
{% for item in tests %}
<tr onclick="window.location.href = '{% url 'test' test_uuid=item.uuid %}';"
class="ui
{% if item.status == 1%}{% endif %}
Expand Down Expand Up @@ -345,7 +345,7 @@ <h4>Tests: {{ test_count }}</h4>
</tr>
</thead>
<tbody id="tests_list">
{% for item in tests.all %}
{% for item in tests %}
{% if item.status != 3 and item.status != 1 and item.status != 5 and item.status != 6%}
<tr class="ui negative" onclick="window.location.href = '{% url 'test' test_uuid=item.uuid %}';">
{% if fw == 1 %}
Expand Down Expand Up @@ -428,7 +428,7 @@ <h4>Tests: {{ test_count }}</h4>
</tr>
</thead>
<tbody id="tests_list">
{% for item in tests.all %}
{% for item in tests %}
{% if item.status == 3 %}
<tr class="ui positive" onclick="window.location.href = '{% url 'test' test_uuid=item.uuid %}';">
{% if fw == 1 %}
Expand Down Expand Up @@ -510,7 +510,7 @@ <h4>Tests: {{ test_count }}</h4>
</tr>
</thead>
<tbody id="tests_list">
{% for item in tests.all %}
{% for item in tests %}
{% if item.status == 6 %}
<tr class="ui negative" onclick="window.location.href = '{% url 'test' test_uuid=item.uuid %}';">
{% if fw == 1 %}
Expand Down Expand Up @@ -592,7 +592,7 @@ <h4>Tests: {{ test_count }}</h4>
</tr>
</thead>
<tbody id="tests_list">
{% for item in tests.all %}
{% for item in tests %}
{% if item.status == 5 %}
<tr class="ui warning" onclick="window.location.href = '{% url 'test' test_uuid=item.uuid %}';">
{% if fw == 1 %}
Expand Down Expand Up @@ -674,7 +674,7 @@ <h4>Tests: {{ test_count }}</h4>
</tr>
</thead>
<tbody id="tests_list">
{% for item in tests.all %}
{% for item in tests %}
{% if item.status == 1 %}
<tr class="ui" onclick="window.location.href = '{% url 'test' test_uuid=item.uuid %}';">
{% if fw == 1 %}
Expand Down Expand Up @@ -1130,4 +1130,4 @@ <h3>Add a bug ID:</h3>
</script>


</html>
</html>
2 changes: 1 addition & 1 deletion main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def job(request, job_uuid):
files = files

status = job_object.status
tests = job_object.tests.select_related('test')
tests = job_object.tests.select_related('test').prefetch_related('test__bugs')

# Statistics
not_started = int(job_object.tests_not_started or 0)
Expand Down
2 changes: 1 addition & 1 deletion management/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def main(request):
@staff_member_required
def about(request):

version = "1.14.1"
version = "1.14.2"

response = requests.get(f"https://api.github.com/repos/and-sm/testgr/releases/latest",
headers={"Content-Type": "application/json", "User-Agent": "testgr"})
Expand Down

0 comments on commit 390b9af

Please sign in to comment.