Skip to content

Commit

Permalink
Naming update
Browse files Browse the repository at this point in the history
  • Loading branch information
SmittieC committed Dec 17, 2024
1 parent 62df778 commit 50dc064
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions apps/pipelines/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def archive(self) -> bool:
if self.get_related_experiments_queryset().exists():
return False

if self.get_static_trigger_experiments():
if len(self.get_static_trigger_experiment_ids()) > 0:
return False

super().archive()
Expand All @@ -289,7 +289,7 @@ def get_node_param_values(self, node_cls, param_name: str) -> list:
def get_related_experiments_queryset(self) -> models.QuerySet:
return self.experiment_set.filter(is_archived=False)

def get_static_trigger_experiments(self) -> models.QuerySet:
def get_static_trigger_experiment_ids(self) -> models.QuerySet:
from apps.events.models import EventAction, EventActionType

return (
Expand All @@ -298,8 +298,8 @@ def get_static_trigger_experiments(self) -> models.QuerySet:
params__pipeline_id=self.id,
static_trigger__is_archived=False,
)
.annotate(experiment=models.F("static_trigger__experiment"))
.values("experiment")
.annotate(trigger_experiment_id=models.F("static_trigger__experiment"))
.values("trigger_experiment_id")
)


Expand Down
2 changes: 1 addition & 1 deletion apps/pipelines/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def delete(self, request, team_slug: str, pk: int):
for experiment in pipeline.get_related_experiments_queryset()
]

query = pipeline.get_static_trigger_experiments()
query = pipeline.get_static_trigger_experiment_ids()
static_trigger_experiments = [
Chip(label=experiment.name, url=experiment.get_absolute_url())
for experiment in Experiment.objects.filter(id__in=Subquery(query)).all()
Expand Down

0 comments on commit 50dc064

Please sign in to comment.