MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / _apply_visibility_limits

Method _apply_visibility_limits

api/audit/views.py:70–86  ·  view source on GitHub ↗
(
        self, queryset: QuerySet[AuditLog]
    )

Source from the content-addressed store, hash-verified

68 return Q()
69
70 def _apply_visibility_limits(
71 self, queryset: QuerySet[AuditLog]
72 ) -> QuerySet[AuditLog]:
73 organisation = self._get_organisation()
74 if not organisation:
75 return AuditLog.objects.none() # type: ignore[no-any-return]
76
77 subscription_metadata = organisation.subscription.get_subscription_metadata()
78 if (
79 subscription_metadata
80 and (limit := subscription_metadata.audit_log_visibility_days) is not None
81 ):
82 queryset = queryset.filter(
83 created_date__gte=timezone.now() - timedelta(days=limit)
84 )
85
86 return queryset
87
88 @abstractmethod
89 def _get_organisation(self) -> Organisation | None:

Callers 1

get_querysetMethod · 0.95

Calls 2

_get_organisationMethod · 0.95

Tested by

no test coverage detected