From c3d99bc9d911a103796821e09f3f65bb543457ca Mon Sep 17 00:00:00 2001 From: David Vogt Date: Thu, 31 Oct 2019 13:23:06 +0100 Subject: [PATCH] feat(model): add `status_skipped` to possible `workitem` states --- caluma/tests/snapshots/snap_test_schema.py | 3 ++ .../migrations/0015_add_work_item_skipped.py | 41 +++++++++++++++++++ caluma/workflow/models.py | 2 + 3 files changed, 46 insertions(+) create mode 100644 caluma/workflow/migrations/0015_add_work_item_skipped.py diff --git a/caluma/tests/snapshots/snap_test_schema.py b/caluma/tests/snapshots/snap_test_schema.py index 196b65880..ce4f994ab 100644 --- a/caluma/tests/snapshots/snap_test_schema.py +++ b/caluma/tests/snapshots/snap_test_schema.py @@ -1860,6 +1860,7 @@ READY COMPLETED CANCELED + SKIPPED } type StringAnswer implements Answer, Node { @@ -2121,12 +2122,14 @@ READY COMPLETED CANCELED + SKIPPED } enum WorkItemStatusArgument { READY COMPLETED CANCELED + SKIPPED } type Workflow implements Node { diff --git a/caluma/workflow/migrations/0015_add_work_item_skipped.py b/caluma/workflow/migrations/0015_add_work_item_skipped.py new file mode 100644 index 000000000..ee84c10c1 --- /dev/null +++ b/caluma/workflow/migrations/0015_add_work_item_skipped.py @@ -0,0 +1,41 @@ +# Generated by Django 2.2.6 on 2019-10-31 12:22 + +from django.db import migrations + +import caluma.core.models + + +class Migration(migrations.Migration): + + dependencies = [("workflow", "0014_add_gin_index_to_jsonfields")] + + operations = [ + migrations.AlterField( + model_name="historicalworkitem", + name="status", + field=caluma.core.models.ChoicesCharField( + choices=[ + ("ready", "Task is ready to be processed."), + ("completed", "Task is done."), + ("canceled", "Task is cancelled."), + ("skipped", "Task is skipped."), + ], + db_index=True, + max_length=50, + ), + ), + migrations.AlterField( + model_name="workitem", + name="status", + field=caluma.core.models.ChoicesCharField( + choices=[ + ("ready", "Task is ready to be processed."), + ("completed", "Task is done."), + ("canceled", "Task is cancelled."), + ("skipped", "Task is skipped."), + ], + db_index=True, + max_length=50, + ), + ), + ] diff --git a/caluma/workflow/models.py b/caluma/workflow/models.py index 4fa10b3f8..5f63d84e0 100644 --- a/caluma/workflow/models.py +++ b/caluma/workflow/models.py @@ -140,12 +140,14 @@ class WorkItem(UUIDModel): STATUS_READY = "ready" STATUS_COMPLETED = "completed" STATUS_CANCELED = "canceled" + STATUS_SKIPPED = "skipped" STATUS_CHOICES = (STATUS_READY, STATUS_COMPLETED, STATUS_CANCELED) STATUS_CHOICE_TUPLE = ( (STATUS_READY, "Task is ready to be processed."), (STATUS_COMPLETED, "Task is done."), (STATUS_CANCELED, "Task is cancelled."), + (STATUS_SKIPPED, "Task is skipped."), ) closed_at = models.DateTimeField(