fix: add vapid diagnostics

This commit is contained in:
2026-07-14 21:25:26 +02:00
parent 5198826f83
commit f783794b86
4 changed files with 158 additions and 16 deletions
+8 -1
View File
@@ -104,7 +104,14 @@ def today(request):
"next_date": day + timedelta(days=1),
"chart": build_chart(readings),
"reading_count": len(readings),
# Empty when push is not configured; the page then hides the card.
# Empty when push is not configured; the card then says so rather than
# vanishing, because a missing card looks like a bug in the page.
"vapid_public_key": settings.VAPID_PUBLIC_KEY,
"doses_with_reminders": ScheduledDose.objects.filter(
is_active=True,
medication__is_active=True,
reminder_time__isnull=False,
).count(),
"subscribed_devices": request.user.push_subscriptions.count(),
},
)