Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 0e7c3096

Přidáno uživatelem David Friesecký před téměř 4 roky(ů)

Re #8590 - Implemented all fields of subject into DB

Zobrazit rozdíly:

src/model/certificate.py
3 3

  
4 4

  
5 5
class Certificate:
6

  
6 7
    def __init__(self,
7 8
                 certificate_id: int,
8
                 common_name: str,
9 9
                 valid_from: str,
10 10
                 valid_to: str,
11 11
                 pem_data: str,
12
                 private_key_id: int,
13 12
                 type_id: int,
14 13
                 parent_id: int,
14
                 private_key_id: int,
15 15
                 usages: Dict[int, bool],
16
                 revocation_date: str = "",
17
                 revocation_reason: str = ""):
16
                 common_name: str,
17
                 country_code: str = None,
18
                 locality: str = None,
19
                 province: str = None,
20
                 organization: str = None,
21
                 organizational_unit: str = None,
22
                 email_address: str = None,
23
                 revocation_date: str = None,
24
                 revocation_reason: str = None):
18 25
        self.certificate_id: int = certificate_id
19
        self.common_name: str = common_name
20 26
        self.valid_from: str = valid_from
21 27
        self.valid_to: str = valid_to
22 28
        self.pem_data: str = pem_data
23
        self.revocation_date = revocation_date
24
        self.revocation_reason = revocation_reason
25
        self.private_key_id: int = private_key_id
26 29
        self.type_id: int = type_id
27 30
        self.parent_id: int = parent_id
31
        self.private_key_id: int = private_key_id
32
        self.common_name: str = common_name
33
        self.country_code: str = country_code
34
        self.locality: str = locality
35
        self.province: str = province
36
        self.organization: str = organization
37
        self.organizational_unit: str = organizational_unit
38
        self.email_address: str = email_address
39
        self.revocation_date: str = revocation_date
40
        self.revocation_reason: str = revocation_reason
28 41
        self.usages: Dict[int, bool] = DICT_USAGES.copy()
29 42

  
30
        if revocation_date is None:
31
            self.revocation_date = ""
43
        #if revocation_date is None:
44
        #    self.revocation_date = ""
32 45

  
33
        if revocation_reason is None:
34
            self.revocation_reason = ""
46
        #if revocation_reason is None:
47
        #    self.revocation_reason = ""
35 48

  
36 49
        for usage_id, usage_value in usages.items():
37 50
            self.usages[usage_id] = usage_value

Také k dispozici: Unified diff