From a3cc844e25a9b132b5b63bd3b422d84584a93b32 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 15 Oct 2022 23:32:02 +0200 Subject: [PATCH] crypto: fix cert_expiry not having the correct format Signed-off-by: Jens Langhammer --- authentik/crypto/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/authentik/crypto/api.py b/authentik/crypto/api.py index ff3391645..bac8d05af 100644 --- a/authentik/crypto/api.py +++ b/authentik/crypto/api.py @@ -14,7 +14,7 @@ from drf_spectacular.types import OpenApiTypes from drf_spectacular.utils import OpenApiParameter, OpenApiResponse, extend_schema from rest_framework.decorators import action from rest_framework.exceptions import ValidationError -from rest_framework.fields import CharField, IntegerField, SerializerMethodField +from rest_framework.fields import CharField, DateTimeField, IntegerField, SerializerMethodField from rest_framework.request import Request from rest_framework.response import Response from rest_framework.serializers import ModelSerializer @@ -69,7 +69,7 @@ class CertificateKeyPairSerializer(ModelSerializer): "Get certificate expiry" if not self._should_include_details: return None - return instance.certificate.not_valid_after + return DateTimeField().to_representation(instance.certificate.not_valid_after) def get_cert_subject(self, instance: CertificateKeyPair) -> Optional[str]: """Get certificate subject as full rfc4514"""