Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 94f8d5cf

Přidáno uživatelem Jan Pašek před téměř 4 roky(ů)

Re #8700 - Implemented certificate revalidation check and fixed affected tests

Zobrazit rozdíly:

src/controllers/certificates_controller.py
14 14
from src.exceptions.unknown_exception import UnknownException
15 15
from src.model.subject import Subject
16 16
from src.services.certificate_service import CertificateService, RevocationReasonInvalidException, \
17
    CertificateStatusInvalidException, CertificateNotFoundException, CertificateAlreadyRevokedException
17
    CertificateStatusInvalidException, CertificateNotFoundException, CertificateAlreadyRevokedException, \
18
    CertificateCannotBeSetToValid
18 19
#  responsibility.
19 20
from src.services.key_service import KeyService
20 21

  
......
357 358
                return E_NO_CERTIFICATE_ALREADY_REVOKED, C_BAD_REQUEST
358 359
            except CertificateNotFoundException:
359 360
                return E_NO_CERTIFICATES_FOUND, C_NOT_FOUND
361
            except CertificateCannotBeSetToValid as e:
362
                return {"success": False, "data": str(e)}, C_BAD_REQUEST
360 363
            return {"success": True,
361 364
                    "data": "Certificate status updated successfully."}, C_SUCCESS
362 365
        # throw an error in case the request does not contain a json body

Také k dispozici: Unified diff