From 9e3c43588a3b4914d484c21dc47b6549f280d303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Wed, 29 Sep 2021 13:41:28 +0300 Subject: [PATCH] Catch correct exception in case of duplicate submission --- pinecrypt/server/api/request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pinecrypt/server/api/request.py b/pinecrypt/server/api/request.py index b831cd0..fe84d42 100644 --- a/pinecrypt/server/api/request.py +++ b/pinecrypt/server/api/request.py @@ -140,7 +140,7 @@ class RequestListResource(object): logger.info("Signed %s as %s is whitelisted for autosign", common_name, req.context["remote"]["addr"]) return - except EnvironmentError: + except errors.RequestExists: logger.info("Autosign for %s from %s failed, signed certificate already exists", common_name, req.context["remote"]["addr"]) reasons.append("autosign failed, signed certificate already exists")