Skip to content

Commit

Permalink
updated_at filter on source/collections
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Oct 12, 2020
1 parent 7ce64ec commit 6b593c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/common/models.py
Expand Up @@ -12,7 +12,7 @@
from pydash import get

from core.common.services import S3
from core.common.utils import reverse_resource, reverse_resource_version
from core.common.utils import reverse_resource, reverse_resource_version, parse_updated_since_param
from core.settings import DEFAULT_LOCALE
from core.sources.constants import CONTENT_REFERRED_PRIVATELY
from .constants import (
Expand Down Expand Up @@ -289,6 +289,7 @@ def get_base_queryset(cls, params):
org = params.get('org', None)
version = params.get('version', None)
is_latest = params.get('is_latest', None)
updated_since = parse_updated_since_param(params)

queryset = cls.objects.filter(is_active=True)
if username:
Expand All @@ -299,6 +300,8 @@ def get_base_queryset(cls, params):
queryset = queryset.filter(version=version)
if is_latest:
queryset = queryset.filter(is_latest_version=True)
if updated_since:
queryset = queryset.filter(updated_at__gte=updated_since)

return queryset

Expand Down

0 comments on commit 6b593c7

Please sign in to comment.