diff options
| -rw-r--r-- | bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py | 19 | ||||
| -rw-r--r-- | bitbake/lib/toaster/orm/models.py | 7 |
2 files changed, 25 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py b/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py new file mode 100644 index 0000000000..91a32a9e00 --- /dev/null +++ b/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | from __future__ import unicode_literals | ||
| 3 | |||
| 4 | from django.db import migrations, models | ||
| 5 | |||
| 6 | |||
| 7 | class Migration(migrations.Migration): | ||
| 8 | |||
| 9 | dependencies = [ | ||
| 10 | ('orm', '0005_task_field_separation'), | ||
| 11 | ] | ||
| 12 | |||
| 13 | operations = [ | ||
| 14 | migrations.AlterField( | ||
| 15 | model_name='build', | ||
| 16 | name='outcome', | ||
| 17 | field=models.IntegerField(default=2, choices=[(0, b'Succeeded'), (1, b'Failed'), (2, b'In Progress'), (3, b'Cancelled')]), | ||
| 18 | ), | ||
| 19 | ] | ||
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index d3277efb1f..7598744a24 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
| @@ -358,11 +358,13 @@ class Build(models.Model): | |||
| 358 | SUCCEEDED = 0 | 358 | SUCCEEDED = 0 |
| 359 | FAILED = 1 | 359 | FAILED = 1 |
| 360 | IN_PROGRESS = 2 | 360 | IN_PROGRESS = 2 |
| 361 | CANCELLED = 3 | ||
| 361 | 362 | ||
| 362 | BUILD_OUTCOME = ( | 363 | BUILD_OUTCOME = ( |
| 363 | (SUCCEEDED, 'Succeeded'), | 364 | (SUCCEEDED, 'Succeeded'), |
| 364 | (FAILED, 'Failed'), | 365 | (FAILED, 'Failed'), |
| 365 | (IN_PROGRESS, 'In Progress'), | 366 | (IN_PROGRESS, 'In Progress'), |
| 367 | (CANCELLED, 'Cancelled'), | ||
| 366 | ) | 368 | ) |
| 367 | 369 | ||
| 368 | search_allowed_fields = ['machine', 'cooker_log_path', "target__target", "target__target_image_file__file_name"] | 370 | search_allowed_fields = ['machine', 'cooker_log_path', "target__target", "target__target_image_file__file_name"] |
| @@ -390,7 +392,10 @@ class Build(models.Model): | |||
| 390 | if project: | 392 | if project: |
| 391 | builds = builds.filter(project=project) | 393 | builds = builds.filter(project=project) |
| 392 | 394 | ||
| 393 | finished_criteria = Q(outcome=Build.SUCCEEDED) | Q(outcome=Build.FAILED) | 395 | finished_criteria = \ |
| 396 | Q(outcome=Build.SUCCEEDED) | \ | ||
| 397 | Q(outcome=Build.FAILED) | \ | ||
| 398 | Q(outcome=Build.CANCELLED) | ||
| 394 | 399 | ||
| 395 | recent_builds = list(itertools.chain( | 400 | recent_builds = list(itertools.chain( |
| 396 | builds.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"), | 401 | builds.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"), |
