From ee19487b379a31f3b0793fac4eafe3a152e9cbb2 Mon Sep 17 00:00:00 2001 From: UserIsMH Date: Wed, 18 Jun 2025 02:39:16 +0200 Subject: [PATCH] =?UTF-8?q?W=C3=A4hlen=20Sie=20einen=20Kunden=20aus=20funk?= =?UTF-8?q?tioniert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2_adminpanel/routes/customer_routes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2_adminpanel/routes/customer_routes.py b/v2_adminpanel/routes/customer_routes.py index 9ec4507..78db397 100644 --- a/v2_adminpanel/routes/customer_routes.py +++ b/v2_adminpanel/routes/customer_routes.py @@ -293,8 +293,8 @@ def api_customer_licenses(customer_id): l.valid_until, l.device_limit, l.created_at, - (SELECT COUNT(*) FROM sessions s WHERE s.license_key = l.license_key AND s.is_active = true) as active_sessions, - (SELECT COUNT(DISTINCT hardware_id) FROM sessions s WHERE s.license_key = l.license_key) as registered_devices, + (SELECT COUNT(*) FROM sessions s WHERE s.license_id = l.id AND s.is_active = true) as active_sessions, + (SELECT COUNT(DISTINCT hardware_id) FROM device_registrations dr WHERE dr.license_id = l.id) as registered_devices, CASE WHEN l.valid_until < CURRENT_DATE THEN 'abgelaufen' WHEN l.valid_until < CURRENT_DATE + INTERVAL '30 days' THEN 'läuft bald ab'