Fixing UT for key_type on upload schema
This commit is contained in:
@ -376,7 +376,13 @@ class CertificateUploadInputSchema(CertificateCreationSchema):
|
||||
|
||||
@pre_load
|
||||
def load_data(self, data):
|
||||
data["key_type"] = utils.get_key_type_from_certificate(data["body"])
|
||||
if data.get("body"):
|
||||
try:
|
||||
data["key_type"] = utils.get_key_type_from_certificate(data["body"])
|
||||
except ValueError:
|
||||
raise ValidationError(
|
||||
"Public certificate presented is not valid.", field_names=["body"]
|
||||
)
|
||||
|
||||
|
||||
class CertificateExportInputSchema(LemurInputSchema):
|
||||
|
Reference in New Issue
Block a user