Revize 8ff50e4e
Přidáno uživatelem Jan Pašek před téměř 4 roky(ů)
src/services/certificate_service.py | ||
---|---|---|
6 | 6 |
from src.constants import ROOT_CA_ID, INTERMEDIATE_CA_ID, CA_ID, CERTIFICATE_ID, CERTIFICATE_STATES, \ |
7 | 7 |
CERTIFICATE_REVOCATION_REASONS |
8 | 8 |
from src.dao.certificate_repository import CertificateRepository |
9 |
from src.exceptions.certificate_not_found_exception import CertificateNotFoundException |
|
9 | 10 |
from src.exceptions.database_exception import DatabaseException |
10 | 11 |
from src.exceptions.unknown_exception import UnknownException |
11 | 12 |
from src.model.certificate import Certificate |
... | ... | |
399 | 400 |
return f"Certificate status '{self.status}' is not valid." |
400 | 401 |
|
401 | 402 |
|
402 |
class CertificateNotFoundException(Exception): |
|
403 |
""" |
|
404 |
Exception that denotes that the caller was trying to set |
|
405 |
work with non-existing certificate |
|
406 |
""" |
|
407 |
|
|
408 |
def __init__(self, id): |
|
409 |
self.id = id |
|
410 |
|
|
411 |
def __str__(self): |
|
412 |
return f"Certificate id '{self.id}' does not exist." |
|
413 |
|
|
414 |
|
|
415 | 403 |
class CertificateAlreadyRevokedException(Exception): |
416 | 404 |
""" |
417 | 405 |
Exception that denotes that the caller was trying to revoke |
Také k dispozici: Unified diff
Re #8576 - moved CertificateNotFoundException to separate file