fix: clone workflow custom fields correctly

This commit is contained in:
caoqianming 2026-03-19 21:49:06 +08:00
parent 076eb4fc98
commit e1020f4a96
1 changed files with 1 additions and 1 deletions

View File

@ -161,7 +161,7 @@ class WorkflowViewSet(CustomModelViewSet):
cf.workflow = wf_new cf.workflow = wf_new
for f in CustomField._meta.fields: for f in CustomField._meta.fields:
if f.name not in ['workflow', 'create_time', 'update_time', 'id']: if f.name not in ['workflow', 'create_time', 'update_time', 'id']:
setattr(sta, f.name, getattr(s, f.name)) setattr(cf, f.name, getattr(c, f.name))
cf.save() cf.save()
for t in Transition.objects.filter(workflow=wf): for t in Transition.objects.filter(workflow=wf):
tr = Transition() tr = Transition()