Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.db.models.fields import DateField

from ...models import LinkAggregate
from extlinks.links.models import LinkEvent
from extlinks.links.models import LinkEvent, URLPattern
from extlinks.organisations.models import Collection


Expand Down Expand Up @@ -117,6 +117,8 @@ def _process_single_collection(self, link_event_filter, collection):
None
"""
url_patterns = collection.get_url_patterns()
if len(url_patterns) == 0:
url_patterns = URLPattern.objects.filter(collection=collection).all()
for url_pattern in url_patterns:
link_events_with_annotated_timestamp = url_pattern.link_events.annotate(
timestamp_date=Cast("timestamp", DateField())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.db.models.fields import DateField

from ...models import PageProjectAggregate
from extlinks.links.models import LinkEvent
from extlinks.links.models import LinkEvent, URLPattern
from extlinks.organisations.models import Collection

logger = logging.getLogger("django")
Expand Down Expand Up @@ -118,6 +118,8 @@ def _process_single_collection(self, link_event_filter, collection):
None
"""
url_patterns = collection.get_url_patterns()
if len(url_patterns) == 0:
url_patterns = URLPattern.objects.filter(collection=collection).all()
for url_pattern in url_patterns:
link_events_with_annotated_timestamp = url_pattern.link_events.annotate(
timestamp_date=Cast("timestamp", DateField())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.db.models.fields import DateField

from ...models import UserAggregate
from extlinks.links.models import LinkEvent
from extlinks.links.models import LinkEvent, URLPattern
from extlinks.organisations.models import Collection


Expand Down Expand Up @@ -117,6 +117,8 @@ def _process_single_collection(self, link_event_filter, collection):
None
"""
url_patterns = collection.get_url_patterns()
if len(url_patterns) == 0:
url_patterns = URLPattern.objects.filter(collection=collection).all()
for url_pattern in url_patterns:
link_events_with_annotated_timestamp = url_pattern.link_events.annotate(
timestamp_date=Cast("timestamp", DateField())
Expand Down
Loading