diff --git a/authentik/enterprise/license.py b/authentik/enterprise/license.py index 7baa1b378a..88f22e5a7c 100644 --- a/authentik/enterprise/license.py +++ b/authentik/enterprise/license.py @@ -188,20 +188,21 @@ class LicenseKey: def summary(self) -> LicenseSummary: """Summary of license status""" + has_license = License.objects.all().count() > 0 last_valid = LicenseKey.last_valid_date() show_admin_warning = last_valid < now() - timedelta(weeks=2) show_user_warning = last_valid < now() - timedelta(weeks=4) read_only = last_valid < now() - timedelta(weeks=6) latest_valid = datetime.fromtimestamp(self.exp) return LicenseSummary( - show_admin_warning=show_admin_warning, - show_user_warning=show_user_warning, - read_only=read_only, + show_admin_warning=show_admin_warning and has_license, + show_user_warning=show_user_warning and has_license, + read_only=read_only and has_license, latest_valid=latest_valid, internal_users=self.internal_users, external_users=self.external_users, valid=self.is_valid(), - has_license=License.objects.all().count() > 0, + has_license=has_license, ) @staticmethod