Skip to content

Commit

Permalink
feat(model): add status_skipped to possible workitem states
Browse files Browse the repository at this point in the history
  • Loading branch information
David Vogt committed Oct 31, 2019
1 parent 2d06f9d commit c3d99bc
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions caluma/tests/snapshots/snap_test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,7 @@
READY
COMPLETED
CANCELED
SKIPPED
}
type StringAnswer implements Answer, Node {
Expand Down Expand Up @@ -2121,12 +2122,14 @@
READY
COMPLETED
CANCELED
SKIPPED
}
enum WorkItemStatusArgument {
READY
COMPLETED
CANCELED
SKIPPED
}
type Workflow implements Node {
Expand Down
41 changes: 41 additions & 0 deletions caluma/workflow/migrations/0015_add_work_item_skipped.py
Original file line number Diff line number Diff line change
@@ -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,
),
),
]
2 changes: 2 additions & 0 deletions caluma/workflow/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c3d99bc

Please sign in to comment.