Skip to content

Commit

Permalink
Added a tweak to optimise the method.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrbyers committed Mar 19, 2024
1 parent e1b486e commit 4218c13
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/submission/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1680,14 +1680,8 @@ def workflow_stages(self):
return core_models.WorkflowLog.objects.filter(article=self)

def distinct_workflow_elements(self):
workflow_element_ids = core_models.WorkflowLog.objects.filter(
article=self,
).values_list(
'element'
).distinct()

return core_models.WorkflowElement.objects.filter(
pk__in=[element_id[0] for element_id in workflow_element_ids]
pk__in=self.workflowlog_set.values_list("element").distinct()
)

@property
Expand Down

0 comments on commit 4218c13

Please # to comment.