This commit is contained in:
j3d1 2026-08-31 13:41:03 +02:00
parent 2218cc3543
commit 4671860fa4
6 changed files with 166 additions and 2 deletions

View file

@ -0,0 +1,18 @@
# Generated by Django 4.2.2
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('toolshed', '0023_remove_storagelocation_storagelocation_unique_owner_scoped_id_and_more'),
]
operations = [
migrations.AddField(
model_name='workflowinstance',
name='current_step',
field=models.PositiveIntegerField(default=1),
),
]

View file

@ -236,6 +236,7 @@ class StorageLocation(models.Model):
class WorkflowInstance(models.Model):
slug = models.CharField(max_length=255)
state = models.CharField(max_length=255)
current_step = models.PositiveIntegerField(default=1)
payload = models.TextField(default='', blank=True) # an opaque, frontend-serialized JSON string on the backend.
owner = models.ForeignKey(ToolshedUser, on_delete=models.CASCADE, related_name='workflows')
staged_files = models.ManyToManyField(File, related_name='staged_by_workflows', blank=True)

View file

@ -319,7 +319,7 @@ class WorkflowInstanceSerializer(serializers.ModelSerializer):
class Meta:
model = WorkflowInstance
fields = ['id', 'slug', 'state', 'payload', 'owner', 'staged_files', 'created_at', 'updated_at']
fields = ['id', 'slug', 'state', 'current_step', 'payload', 'owner', 'staged_files', 'created_at', 'updated_at']
read_only_fields = ['owner', 'staged_files', 'created_at', 'updated_at']
def get_staged_files(self, obj):