Harden public demo for 0.3.16
This commit is contained in:
@@ -57,7 +57,8 @@ def annotate_latest_profile_score(
|
||||
|
||||
def _recent_dashboard_activity(user: User) -> list[dict[str, Any]]:
|
||||
activity: list[dict[str, Any]] = []
|
||||
for run in SourceRun.objects.select_related("source").order_by("-started_at")[:4]:
|
||||
source_runs = SourceRun.objects.exclude(source__source_type=Source.Type.EMAIL)
|
||||
for run in source_runs.select_related("source").order_by("-started_at")[:4]:
|
||||
activity.append(
|
||||
{
|
||||
"occurred_at": run.started_at,
|
||||
@@ -154,7 +155,9 @@ def build_dashboard_cockpit(user: User, profile: SearchProfile | None) -> dict[s
|
||||
"source_counts": source_counts,
|
||||
"recent_activity": _recent_dashboard_activity(user),
|
||||
"day_conclusion": day_conclusion,
|
||||
"latest_scan": SourceRun.objects.order_by("-started_at").first(),
|
||||
"latest_scan": SourceRun.objects.exclude(source__source_type=Source.Type.EMAIL)
|
||||
.order_by("-started_at")
|
||||
.first(),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user