From 387566a261792502fade345e6e6b094172eab9b6 Mon Sep 17 00:00:00 2001 From: sayali Date: Mon, 12 Feb 2024 15:04:30 -0800 Subject: [PATCH] allow optional CN in reissue and clone --- lemur/certificates/schemas.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lemur/certificates/schemas.py b/lemur/certificates/schemas.py index f6a7a0b958..4918729513 100644 --- a/lemur/certificates/schemas.py +++ b/lemur/certificates/schemas.py @@ -369,6 +369,11 @@ def handle_subject_details(self, data): if field in data and data[field] is None: data.pop(field) + # Earlier common_name was a required field and thus in most places there is no None check for it. + # Now that it is optional, setting value as empty string instead of None for backward compatibility + if data.get("common_name") is None: + data["common_name"] = "" + class CertificateShortOutputSchema(LemurOutputSchema): id = fields.Integer()