Skip to content

Commit ceb9409

Browse files
committed
fix: es6 usage count to migrate
1 parent 655d9dc commit ceb9409

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

osf/management/commands/migrate_osfmetrics_6to8.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,9 +669,14 @@ def _handle_usage_events(self, *, start: bool, no_counts: bool):
669669
}
670670
}
671671
}
672+
_es6_usage_count_q = {
673+
'bool': {
674+
'filter': [_range_q, {'exists': {'field': 'item_guid'}}],
675+
},
676+
}
672677
_es6_pview_count = PreprintView.search().filter(_range_q).count()
673678
_es6_pdownload_count = PreprintDownload.search().filter(_range_q).count()
674-
_es6_usage_event_count = CountedUsageEs6.search().filter(_range_q).count()
679+
_es6_usage_event_count = CountedUsageEs6.search().filter(_es6_usage_count_q).count()
675680
_es6_count = (
676681
_es6_pview_count + _es6_pdownload_count + _es6_usage_event_count
677682
)
@@ -720,7 +725,7 @@ def _handle_usage_reports(self, *, start: bool, no_counts: bool):
720725
self._write_tabbed(
721726
'es8',
722727
es8_metrics.MonthlyPublicItemUsageReportEs8,
723-
'(items)',
728+
'osfid count:',
724729
_es8_item_count,
725730
style=self._eq_style(_es8_item_count, _es6_item_count),
726731
)

0 commit comments

Comments
 (0)