diff --git a/authentik/enterprise/api.py b/authentik/enterprise/api.py index 5cfc5c3fc5..bdacbcba5d 100644 --- a/authentik/enterprise/api.py +++ b/authentik/enterprise/api.py @@ -18,7 +18,7 @@ from authentik.core.api.used_by import UsedByMixin from authentik.core.api.utils import ModelSerializer, PassiveSerializer from authentik.core.models import User, UserTypes from authentik.enterprise.license import LicenseKey, LicenseSummarySerializer -from authentik.enterprise.models import License, LicenseUsageStatus +from authentik.enterprise.models import License from authentik.rbac.decorators import permission_required from authentik.tenants.utils import get_unique_identifier @@ -29,7 +29,7 @@ class EnterpriseRequiredMixin: def validate(self, attrs: dict) -> dict: """Check that a valid license exists""" - if LicenseKey.cached_summary().status != LicenseUsageStatus.UNLICENSED: + if not LicenseKey.cached_summary().status.is_valid: raise ValidationError(_("Enterprise is required to create/update this object.")) return super().validate(attrs)