Skip to content

Commit 219caaa

Browse files
authored
Merge pull request #472 from WikipediaLibrary/kgraessle/T404879
Backfill missing Wall Street Journal aggregate data
2 parents 36d9894 + 3e53474 commit 219caaa

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

extlinks/aggregates/management/commands/reaggregate_link_archives.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,7 @@ def _fill_daily_pageproject_aggregates(self, change_number, collection, link_eve
286286
link_event["fields"]["timestamp"]
287287
).date(),
288288
on_user_list=link_event['fields']["on_user_list"],
289-
).exclude(day=0)[:1].all()
290-
existing_pageproject_aggregate = (
291-
existing_pageproject_aggregate[0] if len(existing_pageproject_aggregate) > 0 else None
292-
)
289+
).exclude(day=0).first()
293290
if existing_pageproject_aggregate:
294291
if change_number == 0:
295292
existing_pageproject_aggregate.total_links_removed += 1
@@ -570,7 +567,7 @@ def _fill_monthly_page_project_aggregates(self, collection, events, last_day_of_
570567
day=0,
571568
full_date=last_day_of_month,
572569
on_user_list=on_user_list_flag,
573-
)[:1].all()
570+
).first()
574571
if existing_page_project_aggregate:
575572
existing_page_project_aggregate.total_links_added = total_added_page_project
576573
existing_page_project_aggregate.total_links_removed = total_removed_page_project

0 commit comments

Comments
 (0)