Fix cert reissue when L/OU is not set

get_certificate_primitives complains with None L/OU
This commit is contained in:
sayali 2020-10-20 16:43:57 -07:00
parent ea33fe9979
commit 788703ce12
1 changed files with 6 additions and 0 deletions

View File

@ -353,6 +353,12 @@ class CertificateOutputSchema(LemurOutputSchema):
data.pop("organization", None)
data.pop("organizational_unit", None)
# Removing optional fields if None, else it complains in de-serialization
if "location" in data and data["location"] is None:
data.pop("location")
if "organizational_unit" in data and data["organizational_unit"] is None:
data.pop("organizational_unit")
class CertificateShortOutputSchema(LemurOutputSchema):
id = fields.Integer()