Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions api/features/versioning/managers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import typing
from pathlib import Path

from django.db.models import Exists, OuterRef
from django.db.models.query import QuerySet, RawQuerySet
from django.utils import timezone
from softdelete.models import SoftDeleteManager # type: ignore[import-untyped]
Expand All @@ -15,19 +14,6 @@


class EnvironmentFeatureVersionManager(SoftDeleteManager): # type: ignore[misc]
def get_live_or_scheduled(self) -> QuerySet["EnvironmentFeatureVersion"]:
"""Get the published versions that are live now or scheduled to go live."""
superseding_versions = self.filter(
feature_id=OuterRef("feature_id"),
environment_id=OuterRef("environment_id"),
published_at__isnull=False,
live_from__gt=OuterRef("live_from"),
live_from__lte=timezone.now(),
)
return self.filter(published_at__isnull=False).exclude( # type: ignore[no-any-return]
Exists(superseding_versions)
)

def get_latest_versions_by_environment_id(self, environment_id: int) -> RawQuerySet: # type: ignore[type-arg]
"""
Get the latest EnvironmentFeatureVersion objects for a given environment.
Expand Down
Loading