0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00

Add unique together on WorkflowTask for 'workflow' and 'task' to avoid duplicates making TaskState queries difficult in future

This commit is contained in:
jacobtm 2019-11-08 16:33:36 +00:00 committed by Matt Westcott
parent 3db9779260
commit 00ba5810fc

View File

@ -2407,7 +2407,7 @@ class WorkflowTask(Orderable):
task = models.ForeignKey('Task', on_delete=models.CASCADE, verbose_name=_('task'), related_name='workflow_tasks')
class Meta:
unique_together = [('workflow', 'sort_order')]
unique_together = [('workflow', 'sort_order'), ('workflow', 'task')]
verbose_name = _('workflow task order')
verbose_name_plural = _('workflow task orders')